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
17
votes
1 answer

Gaussian Smoothing an image in python

I am very new to programming in python, and im still trying to figure everything out, but I have a problem trying to gaussian smooth or convolve an image. This is probably an easy fix, but I've spent so much time trying to figure it out im starting…
Jenn
  • 171
  • 1
  • 1
  • 4
17
votes
3 answers

Image smoothing in R

How can I smooth this picture in R, so that only two peaks remain? If this would be 1d data, I would do a running mean or fit a regression function to it. But I did not find very specific information about applying these methods on a 2d matrix. For…
nnn
  • 4,985
  • 4
  • 24
  • 34
17
votes
3 answers

Gradient in noisy data, python

I have an energy spectrum from a cosmic ray detector. The spectrum follows an exponential curve but it will have broad (and maybe very slight) lumps in it. The data, obviously, contains an element of noise. I'm trying to smooth out the data and…
Lucidnonsense
  • 1,195
  • 3
  • 13
  • 35
16
votes
3 answers

Smoothing out a curve

I have two lists of data points: list_x = [-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,…
Fxs7576
  • 1,259
  • 4
  • 23
  • 31
16
votes
1 answer

Generating smooth line graph using matplotlib

Following is the python script to generate a plot using matplotlib. #!/usr/bin/python import matplotlib.pyplot as plt import time import numpy as np from scipy.interpolate import spline # Local variables x = [] y = [] # Open the data file for…
AnilJ
  • 1,951
  • 2
  • 33
  • 60
15
votes
3 answers

How do I plot the first derivative of the smoothing function?

I have the following script that emulates the type of data structure I have and analysis that I want to do on it, library(ggplot2) library(reshape2) n <- 10 df <- data.frame(t=seq(n)*0.1, a =sort(rnorm(n)), b =sort(rnorm(n)), …
lafras
  • 8,712
  • 4
  • 29
  • 28
15
votes
2 answers

How to output smooth cspline curve as a data file

Does anybody know how to extract some data of smooth cspline curve for a given data? For instance, there is a data file which has 2 columns corresponding to x and y values. I can draw the data with smooth cpline curve by the following commands p…
user4914499
  • 344
  • 1
  • 3
  • 12
15
votes
3 answers

Image smoothing in Python

I wanted to try to write a simple function to smooth an inputted image. I was trying to do this using the Image and numpy libraries. I was thinking that using a convolution mask would be an approach to this problem and I know numpy has a convolve…
Nick
  • 9,285
  • 33
  • 104
  • 147
14
votes
3 answers

Numpy Root-Mean-Squared (RMS) smoothing of a signal

I have a signal of electromyographical data that I am supposed (scientific papers' explicit recommendation) to smooth using RMS. I have the following working code, producing the desired output, but it is way slower than I think it's…
heltonbiker
  • 26,657
  • 28
  • 137
  • 252
14
votes
2 answers

Math: Ease In, ease Out a displacement using Hermite curve with time constraint

I'm trying to write a method that interpolates from 0 to x (position of an object in one dimension) over time using acceleration at the beginning and deceleration at the end (ease out / ease in) with the only constraints that the total time is…
742
  • 3,009
  • 3
  • 23
  • 18
14
votes
1 answer

Can't reproduce stat_smooth using `loess` when x-axis is Date

I am using ggplot2 to get a smoothed estimation of my data ggplot(yy)+geom_smooth(aes(x=Date,y=value),method='loess') It works fine. Now, when try to reproduce this using loess function directly, I get an error: loess(value~Date,yy) Error in…
agstudy
  • 119,832
  • 17
  • 199
  • 261
14
votes
9 answers

jQuery: Scroll to anchor when calling URL, replace browsers behaviour

I already know the jQuery plugin ScrollTo, but I didn't find any way up to now to realize the following: The users gets to my site (by typing, NOT by clicking a link on my page) domain.com/bla.php#foo and the anchor "#foo" exists. Now I want that…
bj.
  • 143
  • 1
  • 1
  • 4
13
votes
1 answer

How can I smooth elements of a two-dimensional array with differing gaussian functions in python?

How could I smooth the x[1,3] and x[3,2] elements of the array, x = np.array([[0,0,0,0,0],[0,0,0,1,0],[0,0,0,0,0],[0,0,1,0,0],[0,0,0,0,0]]) with two two-dimensional gaussian functions of width 1 and 2, respectively? In essence I need a function…
astro_ash
  • 145
  • 1
  • 1
  • 7
13
votes
1 answer

Plotting a smooth curve in matplotlib graphs

I am reading a netcdf file using python and need to plot a graphs using matplotlib library in python. The netcdf file is containing 3 variables: u v and w components. I have to draw these 3 components on a vertical scale. Since these data is going…
user2028750
13
votes
2 answers

How to reproduce smoothScatter's outlier plotting in ggplot?

I am trying to get something like what the smoothScatter function does, only in ggplot. I have figured out everything except for plotting the N most sparse points. Can anyone help me with this? library(grDevices) library(ggplot2) # Make two new…
Ryan C. Thompson
  • 40,856
  • 28
  • 97
  • 159
1 2
3
98 99