msn.mle {sn} | R Documentation |
Fits a multivariate skew-normal (MSN) distribution to data, or fits a linear regression model with multivariate skew-normal errors, using maximum likelihood estimation.
msn.mle(X, y, freq, start, trace=FALSE, algorithm=c("nlminb", "Nelder-Mead", "BFGS", "CG", "SANN"), control=list())
y |
a matrix or a vector. If y is a matrix, rows refer to
observations, and columns to components of the multivariate
distribution. If y is a vector, it is converted to a one-column
matrix, and a scalar skew-normal distribution is fitted.
|
X |
a matrix of covariate values.
If missing, a one-column matrix of 1's is created; otherwise,
it must have the same number of rows of y , and it must
include a column of 1's if an intercept term is required.
|
freq |
a vector of weights.
If missing, a vector of 1's is created; otherwise
it must have length equal to the number of rows of y .
|
start |
a list containing the components beta ,Omega , alpha ,
of the type described below. The dp component of the returned
list from a previous call has the required format.
|
trace |
logical value which controls printing of the algorithm convergence.
If trace=TRUE , details are printed. Default value is FALSE .
|
algorithm |
a character string which selects the numerical optimization procedure
used to maximize the log-likelihood function. If this string is set
equal to "nlminb" , then this function is called; in all other cases,
optim is called, with method set equal to the given string.
Default value is "nlminb" .
|
control |
this parameter is passed to the optimizer selected via algorithm ;
see the documentation of nlminb or optim for its usage.
|
The parameter freq
is intended for use with grouped data,
setting the values of y
equal to the central values of the
cells; in this case the resulting estimate is an approximation
to the exact maximum likelihood estimate. If freq
is not
set, exact maximum likelihood estimation is performed.
The working parameter used in the maximization stage is
c(beta,alpha/omega)
, since a profile `deviance'
-2*loglikelihood
for this parameter is actually used;
see Azzalini and Capitanio (1999, section 6.1) for details.
The selected optimizer (nlminb
or optim
) is called,
supplying the gradient of the profile deviance. In case the
optimizer is optim
), the gradient may or may not
be used, depending on which specific method has been selected.
The function can take a vector y
as input; however the use of
sn.mle
is recommended in the scalar case.
A list containing the following components:
call |
a string containing the calling statement. |
dp |
a list containing terms named beta , Omega , alpha ,
where beta is a matrix of regression coefficients with
dim(beta)=c(nrow(X),ncol(y)) , Omega is a covariance
matrix of order ncol(y) , alpha is a vector of shape
parameters of length ncol(y) .
|
se |
a list containing the components beta , alpha , info .
Here, beta and alpha are the standard errors for the
corresponding point estimates;
info is the observed information matrix for the working parameter,
as explained below.
|
algorithm |
the list returned by the chose optimizer, either nlminb
or optim , plus an item with the name of the selected
algorithm; see the documentation of either nlminb
or optim for explanation of the other components.
|
The multivariate skew-normal distribution is discussed by
Azzalini and Dalla Valle (1996); the (Omega,alpha)
parametrization
adopted here is the one of Azzalini and Capitanio (1999).
Azzalini, A. and Dalla Valle, A. (1996). The multivariate skew-normal distribution. Biometrika 83, 715–726.
Azzalini, A. and Capitanio, A. (1999). Statistical applications of the multivariate skew-normal distribution. J.Roy.Statist.Soc. B 61, 579–602.
data(ais, package="sn") attach(ais) # a simple-sample case a <- msn.mle(y=cbind(Ht,Wt)) # # a regression case: b <- msn.mle(X=cbind(1,Ht,Wt), y=ssf) b1 <- msn.mle(X=cbind(1,Ht,Wt), y=ssf, algorithm="Nelder-Mead") b2 <- msn.mle(X=cbind(1,Ht,Wt), y=ssf, start=b1$dp)