Questions tagged [smoothing]

Smoothing related to statistical programing solutions in which a signal is filtered to create an approximating function that attempts to capture important patterns in the data, while leaving out noise, or for visual clarity to see general trends.

In scientific software for statistical computing and graphics, function smooth.spline implements a smoothing spline; function ksmooth implements a kernel estimator; function loess implements LOESS.

1479 questions
293
votes
12 answers

How to smooth a curve for a dataset

Lets assume we have a dataset which might be given approximately by import numpy as np x = np.linspace(0,2*np.pi,100) y = np.sin(x) + np.random.random(100) * 0.2 Therefore we have a variation of 20% of the dataset. My first idea was to use the…
varantir
  • 6,624
  • 6
  • 36
  • 57
174
votes
8 answers

Plot smooth line with PyPlot

I've got the following simple script that plots a graph: import matplotlib.pyplot as plt import numpy as np T = np.array([6, 7, 8, 9, 10, 11, 12]) power = np.array([1.53E+03, 5.92E+02, 2.04E+02, 7.24E+01, 2.72E+01, 1.10E+01,…
Paul
  • 4,239
  • 6
  • 28
  • 29
174
votes
14 answers

RecyclerView - How to smooth scroll to top of item on a certain position?

On a RecyclerView, I am able to suddenly scroll to the top of a selected item by using: ((LinearLayoutManager) recyclerView.getLayoutManager()).scrollToPositionWithOffset(position, 0); However, this abruptly moves the item to the top position. I…
156
votes
12 answers

Smooth GPS data

I'm working with GPS data, getting values every second and displaying current position on a map. The problem is that sometimes (specially when accuracy is low) the values vary a lot, making the current position to "jump" between distant points in…
Al.
  • 1,811
  • 4
  • 15
  • 8
61
votes
15 answers

NumPy version of "Exponential weighted moving average", equivalent to pandas.ewm().mean()

How do I get the exponential weighted moving average in NumPy just like the following in pandas? import pandas as pd import pandas_datareader as pdr from datetime import datetime # Declare variables ibm = pdr.get_data_yahoo(symbols='IBM',…
RaduS
  • 2,465
  • 9
  • 44
  • 65
56
votes
8 answers

scrollintoview animation

My code is at http://jsfiddle.net/mannagod/QT3v5/7/. The JS is: function delay() { var INTENDED_MONTH = 7 //August // INTENDED_MONTH is zero-relative now = new Date().getDate(), rows = document.getElementById('scripture').rows; if…
Ted Lederer
  • 567
  • 1
  • 5
  • 9
48
votes
5 answers

Python natural smoothing splines

I am trying to find a python package that would give an option to fit natural smoothing splines with user selectable smoothing factor. Is there an implementation for that? If not, how would you use what is available to implement it yourself? By…
Niko Föhr
  • 28,336
  • 10
  • 93
  • 96
46
votes
2 answers

kalman 2d filter in python

My input is 2d (x,y) time series of a dot moving on a screen for a tracker software. It has some noise I want to remove using Kalman filter. Does someone can point me for a python code for Kalman 2d filter? In scipy cookbook I found only a 1d…
Noam Peled
  • 4,484
  • 5
  • 43
  • 48
35
votes
1 answer

Plot smooth line through all data points

I'm trying to plot a smooth line that runs directly through all my data points and has a gradient based on another variable. Theoretically polynomial interpolation would get the job done but I'm not sure how I would do that with ggplot. This is what…
moku
  • 4,099
  • 5
  • 30
  • 52
32
votes
3 answers

Confidence interval for LOWESS in Python

How would I calculate the confidence intervals for a LOWESS regression in Python? I would like to add these as a shaded region to the LOESS plot created with the following code (other packages than statsmodels are fine as well). import numpy as…
pir
  • 5,513
  • 12
  • 63
  • 101
31
votes
8 answers

How do I make a CSS triangle with smooth edges?

I have a triangle (JSFiddle) using this CSS: .triangle { width: 0; height: 0; border-top: 0; border-bottom: 30px solid #666699; border-left: 20px solid transparent; border-right: 20px solid transparent; } And this…
kirkaracha
  • 742
  • 2
  • 14
  • 23
31
votes
6 answers

Smoothing a hand-drawn curve

I've got a program that allows users to draw curves. But these curves don't look nice - they look wobbly and hand-drawn. So I want an algorithm that will automatically smooth them. I know there are inherent ambiguities in the smoothing process, so…
thund
  • 1,842
  • 2
  • 21
  • 31
30
votes
6 answers

Smoothing data from a sensor

I have a 3D sensor which measures v(x,y,z) data. I'm only using the x and y data. Smoothing only x and y would be enough. If I use a log to show the data, it shows me something like this: (time) 0.1 ... (Data log) x = 1.1234566667 (time) 0.2 ...…
Mworks
  • 301
  • 1
  • 4
  • 3
27
votes
2 answers

Local linear regression in R -- locfit() vs locpoly()

I am trying to understand the different behaviors of these two smoothing functions when given apparently equivalent inputs. My understanding was that locpoly just takes a fixed bandwidth argument, while locfit can also include a varying part in its…
user1870614
  • 404
  • 1
  • 4
  • 5
22
votes
1 answer

Why can't DirectX/DirectWrite/Direct2D text rendering be as sharp as GDI?

I already know that sub-pixel positioning causes DirectWrite text rendering to be blurry compared to GDI. However, my question is a bit more fundamental: Why can't DirectWrite (and related methods) be made to render text as sharply as GDI? In other…
user541686
  • 205,094
  • 128
  • 528
  • 886
1
2 3
98 99