GaussAmp | R Documentation |
Generate Gaussian curves, according to the equation:
y = y_0+A\mathrm{e}\frac{-(x-c)^2}{2w^2}
GaussAmp(x, c = 0, w = 1, A = 1, y0 = 0)
x |
Values of an independent variable (a vector). |
c |
Center positions on x axis of each Gaussian curve (a scalar or a vector). Default is 0. |
w |
Width of each curve (a scalar or a vector). Default is 1. |
A |
Amplitude of each curve (a scalar or a vector). Default is 1. |
y0 |
Offsets on y axis (a scalar or a vector). Default is 0. |
y - values of dependent variable of Gaussian curve.
The number of curves is determined by maximal number of elements in any of 4 Gausian curve parameters' (c, w, A, y0) vector. Values in other parameters vectors are recycled as ilustrated in example 2 (see parameter "A").
Vilmantas Gegzna
Other curves inspHelper:
unipeak()
library(hyperSpec)
library(spHelper)
# Example 1
x <- seq(-9.9, 10, 0.2)
y <- GaussAmp(x)
plot(x,y, type = "l", col = "green3"); grid()
# Example 2
# Make 7 lines
y <- GaussAmp(x, c = 1:7,A = c(1,2))
dim(y)
##[1] 7 100
Obj <- new("hyperSpec",spc = y, wavelength = x,
label = list (spc = "y", .wavelength = "x"))
plot(Obj, col = 1:nrow(Obj)); grid()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.