sn.em(X, y, fixed, p.eps=0.0001, l.eps=0.01, trace=FALSE, data=FALSE)
X
is missing, then a one-column
matrix of all 1's is created. If X
is supplied, and an intercept term
is required, then it must include a column of 1's.fixed=c(NA,NA,NA)
,
which is the default setting, a global maximization is performed.
If the 3rd component is given a value, then maximizattrace=TRUE
, details are printed. Default value is F
.data=TRUE
, the returned list includes the original
data. Default value is data=FALSE
.data=TRUE
), a list containing X
and y,
as supplied
on input, and a vector of residuals
, which should have an approximate
SN distribution with location=0
and scale=1
, in the direct
parametrization.
This function is based on the EM algorithm; it is generally quite slow,
but it appears to be very robust.
See sn.mle
for an alternative method, which also returns standard
errors.
Azzalini, A. and Capitanio, A. (1999). Statistical applications of the multivariate skew-normal distribution. J.Roy.Statist.Soc. B 61, 579--602.
dsn
, sn.mle
, cp.to.dp
data(ais, package="sn")
attach(ais)
#
a<-sn.em(y=bmi)
#
a<-sn.em(X=cbind(1,lbm,lbm^2),y=bmi)
#
M<-model.matrix(~lbm+I(ais$sex))
b<-sn.em(M,bmi)
#
fit <- sn.em(y=bmi, fixed=c(NA, 2, 3), l.eps=0.001)
Run the code above in your browser using DataLab