sn.mle(X, y, cp, plotit=TRUE, trace=FALSE, method="L-BFGS-B",
control=list(iter.max=100, abs.tol=1e-5))NAs) are not allowed.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.
Missing values (NAs) are length(cp)=ncol(X)+2plotit=TRUE (default) and a graphical device is active,
a plot of the nonparametric estimate of variable y (or the residuals,
in the case of regression), and the parametric fit is superimposed.
See below for dettrace=TRUE, details are printed. Default value is FALSE.optim; see the
documentation of this function for its usage. Default value is
"L-BFGS-B".optim;
see the documentation of this function for its usage.ncol(X)+2 with the centred parameterscp componentcp componentoptim; see the documentation
of this function for explanation of its components.plotit=TRUE and a graphical device is active, a plot is produced,
as described above.optim is used, supplying the gradient of the log-likelihood.
Convergence is generally fast and reliable, but inspection of
the returned message from optim is always appropriate.
In suspect cases, re-run the function changing the starting cp
vector.If plotting operates, the function sm.density of the library sm
is searched; this library is associated with the book by Bowman and
Azzalini (1997). If sm.density is not found, an histogram is plotted.
Azzalini, A. and Capitanio, A. (1999). Statistical applications of the multivariate skew-normal distribution. J.Roy.Statist.Soc. B 61, 579--602.
Bowman, A.W. and Azzalini, A. (1997). Applied Smoothing Techniques for Data Analysis: the Kernel Approach with S-Plus Illustrations. Oxford University Press, Oxford.
dsn, sn.em, msn.mle, optimdata(ais,package=sn)
attach(ais)
a<-sn.mle(y=bmi)
#
a<-sn.mle(X=cbind(1,lbm,lbm^2),y=bmi)
#
M<-model.matrix(~lbm+I(ais$sex))
b<-sn.mle(M,bmi)Run the code above in your browser using DataLab