msn.fit(X, y, freq, plot.it=TRUE, trace=FALSE, ...)
y
is a matrix, its rows refer to
observations, and its 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 distributy
.y
.trace=TRUE
, details are printed. Default value is FALSE
.msn.mle
; in practice, the
start
, the algorithm
and the control
parameters
can be passed.beta
, Omega
, alpha
.
Here, 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)
.dp
.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.msn.mle
for its explanationtest
and p.value
, which are the value
of the likelihood ratio test statistic for normality (i.e. test that
all components of the shape parameter are 0), and the corresponding
p-value.(plot.it & missing(freq))=TRUE
and
a suitable device is active. Three plots are produced, and the programs
pauses between each two of them, waiting for the The first plot uses the variable y
if X
is missing, otherwise
it uses the residuals from the regression.
The form of this plot depends on the value of k=ncol(y)
;
if k=1
, an histogram is plotted with the fitted distribution
superimposed. If k>1
, a matrix of scatterplots is produced, with
superimposed the corresponding bivariate densities of the fitted
distribution.
The second plot has two panels, each representing a QQ-plot of Mahalanobis distances. The first of these refers to the fitting of a multivariate normal distribution, a standard statistical procedure; the second panel gives the corresponding QQ-plot of suitable Mahalanobis distances for the multivariate skew-normal fit.
The third plot is similar to the previous one, except that PP-plots are produced.
(Omega,alpha)
parametrization
adopted here is the one of Azzalini and Capitanio (1999).msn.fit
invokes msn.mle
which does the actual computational work;
then, msn.fit
displays the results in graphical form.
The documentation of msn.mle
gives details of the numerical
procedure for maximum likelihood estimation.Although the function accepts a vector y
as input, the use of
sn.mle
is recommended in the scalar case.
Azzalini, A. and Capitanio, A. (1999). Statistical applications of the multivariate skew-normal distribution. J.Roy.Statist.Soc. B 61, 579--602.
msn.mle
, mst.fit
, dmsn
,data(ais, package="sn")
attach(ais)
# a simple-sample case
b <- msn.fit(y=cbind(Ht,Wt))
#
# a regression case:
a <- msn.fit(X=cbind(1,Ht,Wt), y=bmi, control=list(x.tol=1e-6))
#
# refine the previous outcome
a1 <- msn.fit(X=cbind(1,Ht,Wt), y=bmi, control=list(x.tol=1e-9), start=a$dp)
Run the code above in your browser using DataLab