sn.mle(X, y, cp, plot.it=TRUE, trace=FALSE, method="L-BFGS-B",
control=list(maxit=100))
NA
s) are not allowed.X
is missing, then a one-column matrix of all 1's is created.
If X
is supplied, then it must include a column of 1's.
Missing values (NA
s) are not allowed.length(cp)=ncol(X)+2
plot.it=TRUE
(default),
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 details.trace=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.plot.it=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 package 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.
To fit a skew-normal distribution to grouped data by exact maximum likelihood
estimation, use sn.mle.grouped
.
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
,
optim
, sn.mmle
, sn.mle.grouped
data(ais, package="sn")
attach(ais)
a<-sn.mle(y=bmi)
#
a<-sn.mle(X=cbind(1,lbm),y=bmi)
#
b<-sn.mle(X=model.matrix(~lbm+sex), y=bmi)
Run the code above in your browser using DataLab