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
8
votes
2 answers

Scatter plot kernel smoothing: ksmooth() does not smooth my data at all

Original question I want to smooth my explanatory variable, something like Speed data of a vehicle, and then use this smoothed values. I searched a lot, and find nothing that directly is my answer. I know how to calculate the kernel density…
hajar
  • 103
  • 1
  • 1
  • 5
8
votes
1 answer

how to use Savitzky-Golay smooth coefficient to calculate derivatives

Savitzky-Golay smoothing filter can be used to calculate the coefficients so as to calculate the smoothed y-values by applying the coefficients to the adjacent values. The smoothed curve looks great. According to the papers, the coefficients can…
Lin Song Yang
  • 1,936
  • 19
  • 17
8
votes
3 answers

Kneser-Ney smoothing of trigrams using Python NLTK

I'm trying to smooth a set of n-gram probabilities with Kneser-Ney smoothing using the Python NLTK. Unfortunately, the whole documentation is rather sparse. What I'm trying to do is this: I parse a text into a list of tri-gram tuples. From this list…
Janek Bevendorff
  • 578
  • 1
  • 5
  • 16
8
votes
1 answer

stat_smooth gam not the same as gam {mgcv}

I was using the stat_smooth function in ggplot2, decided I wanted the "goodness of fit", and used a mgcv GAM for that. It occurred to me that I should check to make sure that they were the same model (stat_smooth vs mgcv's gam), so I used the code…
CJ9
  • 91
  • 1
  • 6
8
votes
2 answers

How to create surface plot from greyscale image with Matplotlib?

Let's say I have a greyscale image (size: 550x150 px). I load the image with matplolib import matplotlib.pyplot as plt import matplotlib.image as mp_img image = mp_img.imread("my-cat.png") plt.imshow(image) plt.show() Now, plt.imshow displays the…
BlueLemon
  • 326
  • 1
  • 2
  • 9
8
votes
2 answers

Python smoothing data

I have a dataset that I want smoothed. I have two variables y and x that are not evenly spaced. y is the dependant variable. However, I do no know what formula relates x to y. I read all about interpolation, but interpolation requires me to know…
Alex
  • 941
  • 3
  • 11
  • 23
8
votes
1 answer

How can i draw smooth buffered images in java?

We're making a simple 2D game in Java. Every time we draw images they are jagged and look awful. We can anti-alias the text, but our images are in non-vector formats, so we can not apply anti-aliasing to them. We want to smooth our .JPG images (they…
Petr Župka
  • 111
  • 2
  • 9
8
votes
1 answer

How to plot weighted loess smoothing in ggplot2?

How do I add a loess-smoothing which respects another column as weights? Let's say I have the following data.frame: library(ggplot2) df <- data.frame(x=seq(1:21)) df$y <- df$x*0.3 + 10 df$weight <- 10 df[6,] <- c(6, 0.1, 1) …
JerryWho
  • 3,060
  • 6
  • 27
  • 49
8
votes
3 answers

Using Node.js modules in HTML

I have the following Node.js project (which is a Minimal Working Example of my problem): module1.js: module.exports = function() { return "this is module1!"; }; module2.js: var module1 = require('./module1'); module.exports = function() { …
Erel Segal-Halevi
  • 33,955
  • 36
  • 114
  • 183
8
votes
1 answer

LibGDX - How to smooth out actor drawable when scaling a Scene2d stage?

This is my set-up: stage = new Stage(1280, 800, false); button = new Button(drawableUp, drawableDown); stage.add(button); this gets rendered as following: @Override public void render(float delta) { Gdx.gl.glClearColor(RED,GREEN,BLUE,ALPHA); …
user2127821
7
votes
1 answer

How to solve element flicker while scrolling with parallax effect in JavaScript?

I am trying to re-create website with parallax effect using JavaScript. That means that I have two or more layers, that are moving different speeds while scrolling. In my case I'm moving only one layer, the other one remains static: layer 1 =…
Marakoss
  • 588
  • 1
  • 10
  • 24
7
votes
1 answer

iOS Quartz/CoreGraphics drawing feathered stroke

I am drawing a path into a CGContext following a set of points collected from the user. There seems to be some random input jitter causing some of the line edges to look jagged. I think a slight feather would solve this problem. If I were using…
7
votes
1 answer

How can I reduce latency in a Live Smooth Streaming conferencing solution?

I am using Expression Encoder SDK to encode a live recording of my webcam, publish it to a web server supporting IIS 7.5 and Media Services 4 and viewing it with the SmoothStreamingClient. However, since I'm aiming for a real-time conferencing…
LostKaleb
  • 407
  • 5
  • 12
7
votes
1 answer

Simple curve smoothing in matplotlib --- equivalent to gnuplot's "smooth bezier"?

I have a set of points I want to plot in matplotlib, say: x = [1,4,6,7,8] y = [0.2, 0.4, 0.5, 0.6, 0.6] In gnuplot, I used to be able to directly use the 'plot' command's smooth property to get a smooth curve on a graph, without having to…
Pier1 Sys
  • 1,250
  • 2
  • 12
  • 21
7
votes
1 answer

Smoothen heatmap in plotly

I wanted to create a heatmap of a probability density matrix using plotly. import numpy as np from plotly.offline import download_plotlyjs, init_notebook_mode, plot import plotly.graph_objs as go probability_matrix =…
Ahsan Tarique
  • 581
  • 1
  • 11
  • 22