Questions tagged [gaussian]

For issues related to any of the uses of the Gaussian function. Don't forget to add additional tags to clarify the context.

The graph of a Gaussian is a characteristic symmetric "bell curve" shape that quickly falls off towards plus/minus infinity. The 1-D Gaussian is defined as (taken from wikipedia):

gaussian function from wikipedia

The parameter a is the height of the curve's peak, b is the position of the centre of the peak, and c controls the width of the "bell".

In multiple dimensions, the Gaussian is defined as the product of 1D curves along each dimension.

Gaussian functions are widely used in statistics where they describe the normal distributions, in signal processing where they serve to define Gaussian filters, in image processing where two-dimensional Gaussians are used for Gaussian blurs, in mathematics and physics where they are used to solve heat equations and diffusion equations, to formulate the propagation of optical beams (Gaussian beams), to from a basis set of wavefunctions, to define the Weierstrass transform, and many more.

1812 questions
11
votes
2 answers

Is there a way to get the error in fitting parameters from scipy.stats.norm.fit?

I have some data which I have fitted a normal distribution to using the scipy.stats.normal objects fit function like so: import numpy as np …
SomeRandomPhysicist
  • 1,531
  • 4
  • 19
  • 42
11
votes
1 answer

Calculate how a value differs from the average of values using the Gaussian Kernel Density (Python)

I use this code to calculate a Gaussian Kernel Density on this values from random import randint x_grid=[] for i in range(1000): x_grid.append(randint(0,4)) print (x_grid) This is the code to calculate the Gaussian Kernel Density from…
Usi Usi
  • 2,967
  • 5
  • 38
  • 69
11
votes
4 answers

scipy gaussian_kde and circular data

I am using scipys gaussian_kde to get probability density of some bimodal data. However, as my data is angular (it's directions in degrees) I have a problem when values occur near the limits. The code below gives two example kde's, when the domain…
Dave
  • 1,170
  • 3
  • 20
  • 30
11
votes
1 answer

how to smooth a curve in python

I have an entropy curve (1d numpy array) but this curve has a lot of noise. I would like to delete the noise with a smoothing. This is the plot of my curve: I have tried to solve this issue making a convolution product with a Kaiser-Bessel…
elviuz
  • 639
  • 1
  • 7
  • 26
11
votes
1 answer

Repeated Gaussian Blur in Image Processing

I have two questions relating to repeated Gaussian blur. What happens when we repeatedly apply gaussian blur to an image keeping the sigma and the radius same ? And is it possible that after n iterations of repeatedly applying gaussian blur (sigma…
DK5
  • 317
  • 3
  • 15
11
votes
2 answers

How to generate normally distributed random from an integer range?

Given the start and the end of an integer range, how do I calculate a normally distributed random integer between this range? I realize that the normal distribution goes into -+ infinity. I guess the tails can be cutoff, so when a random gets…
John Smith
11
votes
2 answers

multivariate normal cdf in C, C++, or Fortran

Is there an open source to calculate multivariate (where dimension is large > 3, not bivariate or trivariate ) numerical cdf of gaussian distributions in C, C++ or Fortran? I believe IMSL does…
adam
  • 655
  • 1
  • 10
  • 31
10
votes
2 answers

Spatio-temporal kriging in python using sklearn?

I have weather data available for about 6 weather stations. For all these stations I have the longitude and latitude available, and also the datetime (every 10 minutes from beginning of 2016 or so). I want to use the kriging interpolation method to…
Josh
  • 404
  • 1
  • 5
  • 15
10
votes
1 answer

Gaussian Mixture Models of an Image's Histogram

I am attempting to do automatic image segmentation of the different regions of a 2D MR image based on pixel intensity values. The first step is implementing a Gaussian Mixture Model on the image's histogram. I need to plot the resulting gaussian…
10
votes
2 answers

R + ggplot : how to use a custom smoother (Gaussian Process)

I'm using R. I have 25 variables over 15 time points, with 3 or more replicates per variable per time point. I've melted this into a data.frame, which I can plot happily using (amongst other things) ggplot's facet_wrap() command. My melted data…
Mike Dewar
  • 10,945
  • 14
  • 49
  • 65
10
votes
1 answer

Plot a contour of multivariate normal PDF of a given MVN in MATLAB?

I have a bivariate gaussian I defined as follow: I=[1 0;0 1]; mu=[0,0]; sigma=0.5*I; beta = mvnrnd(mu,sigma,100); %100x2 matrix where each column vector is a variable. now I want to plot a contour of the pdf of the above matrix. What I did: Z =…
Evan
  • 207
  • 2
  • 3
  • 12
10
votes
6 answers

Generating numbers with Gaussian function in a range using python

I want to use the gaussian function in python to generate some numbers between a specific range giving the mean and variance so lets say I have a range between 0 and 10 and I want my mean to be 3 and variance to be 4 mean = 3, variance = 4 how can…
Lily
  • 816
  • 7
  • 18
  • 38
10
votes
5 answers

How to fit a gaussian to data in matlab/octave?

I have a set of frequency data with peaks to which I need to fit a Gaussian curve and then get the full width half maximum from. The FWHM part I can do, I already have a code for that but I'm having trouble writing code to fit the Gaussian. Does…
user1806676
  • 169
  • 1
  • 1
  • 10
10
votes
4 answers

Using the gaussian probability density function in C++

First, is this the correct C++ representation of the pdf gaussian function ? float pdf_gaussian = ( 1 / ( s * sqrt(2*M_PI) ) ) * exp( -0.5 * pow( (x-m)/s, 2.0 ) ); Second, does it make sense of we do something like this ? if(pdf_gaussian <…
shn
  • 5,116
  • 9
  • 34
  • 62
9
votes
2 answers

How to do a Gaussian filtering in 3D

How do i do a gaussi smoothing in the 3th dimension? I have this detection pyramid, votes accumulated at four scales. Objects are found at each peak. I already smoothed each of them in 2d, and reading in my papers that i need to filter the third…
Poul K. Sørensen
  • 16,950
  • 21
  • 126
  • 283