Maximum likelihood estimation for skew-normal models

Usage

sn_mle(X, y, cp, plotit, traceout, iter_max, abs_tol)

Arguments

y a vector contaning the observed variable. This is the response variable in case of linear regression. Missing values (NaN) are not allowed.
X a matrix of explanatory variables. If 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 (NaN) are not allowed.
cp a vector of initial values for the centred parameters, with length(cp)=size(X,2)+2
plotit logical value, If plotit=1 (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.
traceout logical value which controls printing of the algorithm convergence. If traceout=1, details are printed. Default value is 0.
iter_max this parameter is passed to the optimizer routine and represent the maximum number of iterations (default is 100); see the documentation of 'foptions' for its usage.
abs_tol this parameter is passed to the optimizer routine and represent the absolute tolerance (default is 1e-5); see the documentation of 'foptions' for its usage.

Description

Fits a skew-normal (SN) distribution to data, or fits a linear regression model with skew-normal errors, using maximum likelihood estimation.

Details

The optimizer routine 'constr' is used, supplying gradient. Convergence is generally fast and reliable, but inspection of the returned message from 'options' is always appropriate. In suspect cases, re-run the function changing the starting cp vector.

If plotting operates, an histogram is plotted.

Value

a list containing the following components:

cp a vector of length size(X,2)+2 with the centred parameters.
logL the log-likelihood at convergence
se a vector of standard errors for the cp component.
info the observed information matrix for the cp component.
options messages from the optimisation routine; see the documentation of foptions for explanation of its components.

BACKGROUND

Background information on the SN distribution is given by Azzalini (1985). See Azzalini and Capitanio (1998) for a more detailed discussion of the centred parametrization.

References

Azzalini, A. (1985). A class of distributions which includes the normal ones. Scand. J. Statist. 12, 171-178.

Azzalini, A. and Capitanio, A. (1999). Statistical applications of the multivariate skew-normal distribution. J.Roy.Statist.Soc. B 61, part 3.

See Also

dsn, msn_mle

Examples

a = sn_mle(NaN,bmi)
#
a = sn_mle([ones(length(lbm),1),lbm,lbm^2],bmi)


[Package Contents]