gauss | R Documentation |
The function takes in a vector "X"" against which it returns a vector with the gaussian with the other parameters "amp", "mu", "sig" and "probability"
gauss(X, amp, sig, mu)
gauss(X, amp, sig, mu, probability=F)
gauss(X, sig, mu, probability=T)
X |
The (numeric) vector which contain the |
probability |
A single boolean value. |
amp |
Amplitude, |
sig |
Describes the standard deviation, |
mu |
Describes the mean value, |
The function returns the vector y_i
against the inputs x_i
as shown below.
y_i = Ae^{-(x_i - \mu)^2/(2\sigma^2)} \quad \text{with} \quad A\sqrt{2\pi} = 1/\sigma \,\,\, \text{normalization for density functions}
The returned value is always a numeric vector.
Chitran Ghosal
https://en.wikipedia.org/wiki/Gaussian_function
X <- seq(-10,10,by=0.5)
y <- gauss(X, sig = 1.5, mu = 3, probability = T)
y1 <- gauss(X, amp=1, sig = 1.5, mu = 3, probability = F)
plot(X,y1, type = 'b')
lines(X,y, type='b', col='red')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.