Return the evaluation of a vector with Gaussian-based model
Source:R/gaussmodel.r
func.gaussmodel.RdEvaluate an input vector x with Gaussian-based model and
return its vector.
By default, it evaluate with the best model and its density, but
it can designate the model by index and also can evaluate with a cumulative
distribution.
Usage
# S3 method for gaussmodel
func(model, x, cdf = FALSE, n = 1, scaling = FALSE, ...)Arguments
- model
gaussmodelobject.- x
A numeric vector to be evaluated with a distribution.
- cdf
A logical scalar whether the evaluation is done with a cumulative distribution or not. A default value is
FALSE, which means that the evaluation is done with a density.- n
The index indicates the estimates. 1, by default, is the best estimate, and 2 is the 2nd best, etc.
- scaling
A logical scalar, which indicates whether or not it scales means and standard deviations in
mulistandsdlist. The default value isFALSE.- ...
Arguments to be passed to or from other methods.
Examples
## Create an `gaussmodel` object
gmodel <- gaussmodel(mix2gauss$n200)
## Estimate an model with parameters
gmodel <- estimate(gmodel, deglist=4, mulist=0.15, sdlist=0.73)
#> (4,0.15,0.73)
#> Status: Normal Termination.
## A vector for input
x <- seq(-4, 4, by=0.1)
## Density function
y <- func(gmodel, x)
## Cumulative distribution
y <- func(gmodel, x, cdf=TRUE)