mixalg.VEM | R Documentation |
When fitting finite mixture models two cases must be distinguished. The
flexible support size case, where no assumption about the
number of components k
is made in advance and the fixed support size
case. For the flexible support size case the VEM-algorithm can be used.
The algorithm proceeds as follows:
Step 1: Define an approximating grid lambda[1], ..., lambda[L]
Step 2: Use the VEM algorithm to maximize L(P)
in the simplex
\Omega
and identify grid points with positive support.
mixalg.VEM(mix = NULL, obs=NULL, weights=NULL, data=NULL, pop.at.risk=NULL,
var.lnOR=NULL, family="gaussian", limit=0.01, acc=10^(-7),
numiter=5000, startk=50)
mix |
A CAMAN-object which quantifies a finite mixture model and the input data. |
obs |
observed / dependent variable. Vector or colname of |
weights |
weights of the data. Vector or colname of |
family |
the underlying type density function as a character ("gaussian", "poisson" or "binomial")! |
data |
an optional data frame. |
pop.at.risk |
population at risk: These data could be used to determine a mixture model for Poisson data. Vector or colname of |
var.lnOR |
variances of the data: These variances might be given when working with meta analyses! Vector or colname of |
limit |
parameter to control the limit of union several components. Default is 0.01. |
acc |
convergence criterion. VEM and EM loops stop when deltaLL<acc. Default is 10^(-7). |
numiter |
parameter to control the maximal number of iterations in the VEM and EM loops. Default is 5000. |
startk |
starting/maximal number of components. This number will be used to compute the grid in the VEM. Default is 50. |
The function returns a CAMAN.VEM.object
object.
Peter Schlattmann and Johannes Hoehne
data(vitA)
m0<-mixalg.VEM(obs="logrr",var.lnOR="var",family="gaussian", data=vitA,startk=20)
plot(m0@totalgrid[,2],m0@totalgrid[,3],type="l",xlab="parameter",ylab="gradient")
m1<-mixalg.EM(obs="logrr",var.lnOR="var" ,family="gaussian",p=c(1),t=c(0),data=vitA)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.