Learn R Programming

dsdp (version 0.1.1)

func.gaussmodel: Return the evaluation of a vector with Gaussian-based model

Description

Evaluate 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, ...)

Value

A numeric vector of the evaluatio of input vector x with a model.

Arguments

model

gaussmodel object.

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 mulist and sdlist. The default value is FALSE.

...

Arguments to be passed to or from other methods.

See Also

gaussmodel() summary.gaussmodel() plot.gaussmodel() estimate.gaussmodel() pdf_gaussmodel() cdf_gaussmodel()

Examples

Run this code
## Create an `gaussmodel` object
gmodel <- gaussmodel(mix2gauss$n200)
## Estimate an model with parameters
gmodel <- estimate(gmodel, deglist=4, mulist=0.15, sdlist=0.73)
## 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)

Run the code above in your browser using DataLab