sn_em(X, y, fixed, p_eps, l_eps, traceout, data)
y
| a vector contaning the observed variable. This is the response variable in case of linear regression. |
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.
|
fixed
|
a vector of length 3, indicating which components of the
parameter vector must be regarded as fixed. In fixed=[NaN,NaN,NaN] ,
which is the default setting, a global maximization is performed.
If the 3rd component is given a value, then maximization is performed
keeping that value fixed for the shape parameter. If the 3rd and 2nd
parameters are fixed, then the scale and the shape parameter are
kept fixed. No other patterns of the fixed values are allowed.
|
p_eps
| numerical value which regulates the parameter convergence tolerance (default is 0.0001). |
l_eps
| numerical value which regulates the log-likelihood convergence tolerance (default is 0.01). |
traceout
|
logical value which controls printing of the algorithm
convergence. If traceout=1 , details are printed. Default value is 0.
|
data
|
logical value. If data=1 , the returned list includes the original
data. Default value is data=0 .
|
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.
dp
| a vector of the direct parameters, as explained in the references below. |
cp
| a vector of the centred parameters, as explained in the references below. |
logL
| the log-likelihood at convergence. |
data
|
optionally (if data=1 ), 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.
|
Azzalini, A. and Capitanio, A. (1999). Statistical applications of the multivariate skew-normal distribution. J.Roy.Statist.Soc. B 61, part 3.
dsn
, sn_mle
, cp_to_dp
a = sn_em(NaN,bmi) # a = sn_em([ones(length(lbm),1),lbm,lbm.^2],bmi) # fit = sn_em(NaN,y, [NaN, 2, 3], NaN, 0.001)