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.

1659 questions
127
votes
12 answers

Random Gaussian Variables

Is there a class in the standard library of .NET that gives me the functionality to create random variables that follow Gaussian distribution?
Sebastian Müller
  • 5,071
  • 11
  • 49
  • 79
72
votes
19 answers

JavaScript Math.random Normal distribution (Gaussian bell curve)?

I want to know if the JavaScript function Math.random uses a normal (vs. uniform) distribution or not. If not, how can I get numbers which use a normal distribution? I haven't found a clear answer on the Internet, for an algorithm to create random…
Mangooxx
  • 963
  • 1
  • 9
  • 13
70
votes
4 answers

Overlay normal curve to histogram in R

I have managed to find online how to overlay a normal curve to a histogram in R, but I would like to retain the normal "frequency" y-axis of a histogram. See two code segments below, and notice how in the second, the y-axis is replaced with…
StanLe
  • 4,607
  • 8
  • 34
  • 41
42
votes
5 answers

How to specify upper and lower limits when using numpy.random.normal

I want to be able to pick values from a normal distribution that only ever fall between 0 and 1. In some cases I want to be able to basically just return a completely random distribution, and in other cases I want to return values that fall in the…
Catherine Georgia
  • 799
  • 3
  • 12
  • 16
36
votes
16 answers

Fastest Gaussian blur implementation

How do you implement the fastest possible Gaussian blur algorithm? I am going to implement it in Java, so GPU solutions are ruled out. My application, planetGenesis, is cross platform, so I don't want JNI.
Sid Datta
  • 1,046
  • 2
  • 13
  • 27
36
votes
7 answers

Implementing Gaussian Blur - How to calculate convolution matrix (kernel)

My question is very close to this question: How do I gaussian blur an image without using any in-built gaussian functions? The answer to this question is very good, but it doesn't give an example of actually calculating a real Gaussian filter…
gsingh2011
  • 11,032
  • 21
  • 93
  • 138
36
votes
3 answers

Sample from multivariate normal/Gaussian distribution in C++

I've been hunting for a convenient way to sample from a multivariate normal distribution. Does anyone know of a readily available code snippet to do that? For matrices/vectors, I'd prefer to use Boost or Eigen or another phenomenal library I'm not…
JCooper
  • 5,957
  • 1
  • 20
  • 31
36
votes
6 answers

Random number within a range based on a normal distribution

I want to generate random numbers with a range (n to m, eg 100 to 150), but instead of purely random I want the results to be based on the normal distribution. By this I mean that in general I want the numbers "clustered" around 125. I've found this…
ConfusedAgain
  • 363
  • 1
  • 3
  • 4
32
votes
4 answers

What is the difference between random.normalvariate() and random.gauss() in python?

What is the difference between random.normalvariate() and random.gauss()? They take the same parameters and return the same value, performing essentially the same function. I understand from a previous answer that random.gauss() is not thread safe,…
richnis
  • 541
  • 5
  • 10
30
votes
3 answers

Gaussian filter in MATLAB

Does the 'gaussian' filter in MATLAB convolve the image with the Gaussian kernel? Also, how do you choose the parameters hsize (size of filter) and sigma? What do you base it on?
md86
  • 301
  • 1
  • 3
  • 3
29
votes
7 answers

How to generate 2D gaussian with Python?

I can generate Gaussian data with random.gauss(mu, sigma) function, but how can I generate 2D gaussian? Is there any function like that?
user103021
28
votes
7 answers

Gaussian fit for Python

I'm trying to fit a Gaussian for my data (which is already a rough gaussian). I've already taken the advice of those here and tried curve_fit and leastsq but I think that I'm missing something more fundamental (in that I have no idea how to use the…
Richard Hsia
  • 323
  • 1
  • 3
  • 5
28
votes
8 answers

How to obtain a gaussian filter in python

I am using python to create a gaussian filter of size 5x5. I saw this post here where they talk about a similar thing but I didn't find the exact way to get equivalent python code to matlab function fspecial('gaussian', f_wid, sigma) Is there any…
Khushboo
  • 1,526
  • 6
  • 22
  • 32
26
votes
5 answers

Plotting of 1-dimensional Gaussian distribution function

How do I make plots of a 1-dimensional Gaussian distribution function using the mean and standard deviation parameter values (μ, σ) = (−1, 1), (0, 2), and (2, 3)? I'm new to programming, using Python. Thank you in advance!
pythonnewbie
  • 385
  • 2
  • 6
  • 10
25
votes
2 answers

How to correctly use scikit-learn's Gaussian Process for a 2D-inputs, 1D-output regression?

Prior to posting I did a lot of searches and found this question which might be exactly my problem. However, I tried what is proposed in the answer but unfortunately this did not fix it, and I couldn't add a comment to request further explanation,…
Julie
  • 253
  • 1
  • 3
  • 6
1
2 3
99 100