Examples_bmop: Examples of bmop density estimations

Description Usage Arguments Details Value Examples

Description

Various examples to show the capabilities of bmop estimations.

Usage

1
2
3
4
5
6
7
ex_bmop_gaussian2Mixture(N = 1000, m1 = -3, m2 = 0, lambda = 0.5)

ex_bmop_gaussian3Mixture(N = 1000, m1 = -3, m2 = 0, m3 = +3,
  lambda = c(1, 1, 1))

ex_bmop_gaussianBetaGamma(N = 1000, m1 = -3, m2 = 2, m3 = 3,
  lambda = c(1, 1, 1))

Arguments

N

positive integer, the number of observations

m1,m2,m3

location parameters

lambda

mixing coefficient, vector or double

Details

This functions generate datasets of N observations. The function bmop_fit is then used to estimate the density. A comparative plot is then returned.

ex_bmop_gaussian2Mixture

lambda-mixture of two Gaussian densities with unitary variance and means m1 and m3.

ex_bmop_gaussian3Mixture

lambda-mixture of three Gaussian densities with unitary variance and means m1, m2 and m3.

ex_bmop_gaussianBetaGamma

lambda-mixture of a Gaussian density with unitary variance and mean m1, a Beta density with shape1=2 shape2=5 ncp=m2 and a Gamma density with shape=9 scale=m3/9.

Value

All the functions return an invisible list contating the generated dataset, the estimated bmops and the true density function. See example on how, for example, plot the default kernel density estimation on the same dataset. If bmopPar(mle=TRUE) is called before calling an example function the bmop_fit function will be computed with maximum likelihood estimation.

Examples

1
2
Ex<-ex_bmop_gaussian2Mixture()
points(density(Ex$data),type="l",col="blue",lwd=3)

gherardovarando/Rbmop documentation built on May 17, 2019, 4:17 a.m.