~ubuntu-branches/ubuntu/trusty/r-cran-sn/trusty

« back to all changes in this revision

Viewing changes to man/mst.fit.Rd

  • Committer: Package Import Robot
  • Author(s): Dirk Eddelbuettel
  • Date: 2014-01-14 06:28:00 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20140114062800-yntgbps6kq5et10c
Tags: 1.0-0-1
* New upstream release

* debian/control: Add (Build-)Depends on r-cran-numderiv nomnormt (>= 1.3-1)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
\name{mst.fit}
2
 
\alias{mst.fit}
3
 
\title{
4
 
Fitting multivariate skew-t distributions
5
 
}
6
 
\description{
7
 
Fits a multivariate skew-t (MST) distribution to data, or fits a
8
 
linear regression model with multivariate skew-t errors,
9
 
using maximum likelihood estimation. The outcome is then displayed
10
 
in graphical form.
11
 
}
12
 
\usage{
13
 
mst.fit(X, y, freq, start, fixed.df=NA,  plot.it=TRUE, trace=FALSE, ...)
14
 
}
15
 
\arguments{
16
 
\item{y}{
17
 
a matrix or a vector.  If \code{y} is a matrix, its rows refer to
18
 
observations, and its columns to components of the multivariate
19
 
distribution. If \code{y} is a vector, it is converted to a one-column
20
 
matrix, and a scalar skew-t distribution is fitted.
21
 
}
22
 
\item{X}{
23
 
a matrix of covariate values.
24
 
If missing, a one-column matrix of 1's is created; otherwise,
25
 
it must have the same number of rows of \code{y}.
26
 
}
27
 
\item{freq}{
28
 
a vector of weights.
29
 
If missing, a vector of 1's is created; otherwise
30
 
it must have the same number of rows of \code{y}.
31
 
}
32
 
\item{fixed.df}{
33
 
a scalar value containing the degrees of freedom (df), if these must
34
 
be taken as fixed, or \code{NA} (default value) if df is a parameter
35
 
to be estimated.
36
 
}
37
 
\item{start}{
38
 
a list containing the components \code{beta},\code{Omega}, \code{alpha},
39
 
\code{df} of the type described below. The \code{dp} component of the returned
40
 
list from a previous call has the required format.
41
 
}
42
 
\item{plot.it}{
43
 
logical value which controls the graphical output (default=TRUE);
44
 
see below for description.
45
 
}
46
 
\item{trace}{
47
 
logical value which controls printing of the algorithm convergence.
48
 
If \code{trace=TRUE}, details are printed. Default value is \code{FALSE}.
49
 
}
50
 
\item{...}{
51
 
  additional parameters passed to \code{msn.mle}; in practice, the
52
 
  \code{start}, the \code{algorithm} and the \code{control} parameters
53
 
  can be passed.
54
 
}}
55
 
\value{
56
 
A list containing the following components:
57
 
 
58
 
\item{call}{
59
 
a string containing the calling statement.
60
 
}
61
 
\item{dp}{
62
 
a list containing the direct parameters \code{beta}, \code{Omega}, \code{alpha},
63
 
\code{df}. Here, \code{beta} is a matrix of regression coefficients with
64
 
\code{dim(beta)=c(nrow(X),ncol(y))}, \code{Omega} is a covariance matrix of
65
 
order \code{ncol(y)}, \code{alpha} is a vector of shape parameters of length
66
 
\code{ncol(y)}, \code{df} is a positive scalar.
67
 
}
68
 
\item{logL}{
69
 
log-likelihood evaluated at \code{dp}.
70
 
}
71
 
\item{se}{
72
 
a list containing the components \code{beta}, \code{alpha}, \code{info}.
73
 
Here, \code{beta} and \code{alpha} are the standard errors for the
74
 
corresponding point estimates;
75
 
\code{info} is the observed information matrix for the working parameter,
76
 
as explained below.
77
 
}
78
 
\item{algorithm}{
79
 
  see the documentation of \code{mst.mle} for its explanation
80
 
}
81
 
\item{test.normality}{
82
 
a list with elements \code{test} and \code{p.value}, which are the value
83
 
of the likelihood ratio test statistic for normality (i.e. test that
84
 
 all components of the shape parameter are 0 and \code{df=Inf}), 
85
 
and the corresponding p-value.
86
 
}
87
 
\item{mahalanobis}{
88
 
a list of with elements \code{distance}, \code{prob} and \code{df}, which are 
89
 
the Mahalanobis distances of the residuals from the origin, with respect
90
 
to the metric associated to the matrix \code{Omega}, and the values
91
 
\code{prob} of the associated probabilities computed from the Snedecor's F 
92
 
distribution with  degrees of freedom given by the \code{df} vector of length 
93
 
two, whose first component equals \code{ncol(y)} and the second component is 
94
 
equal to the \code{df} parameter of fitted value ST distribution unless this 
95
 
value has been selected by the used via \code{fixed.df}.
96
 
}}
97
 
\section{Side Effects}{
98
 
Graphical output is produced if \code{(plot.it & missing(freq))==TRUE}. 
99
 
Three plots are produced, and the programs pauses between each two of them, 
100
 
waiting for the <Enter> key to be pressed.
101
 
 
102
 
The first plot uses the variable \code{y} if \code{X} is missing, otherwise
103
 
it uses the residuals from the regression.
104
 
The form of this plot depends on the value of \code{d=ncol(y)};
105
 
if \code{d=1}, an histogram is plotted with the fitted distribution
106
 
superimposed. If \code{d>1}, a matrix of scatter-plots is produced, with
107
 
superimposed the corresponding bivariate densities of the fitted
108
 
distribution.
109
 
 
110
 
The second plot has two panels, each representing a QQ-plot of
111
 
Mahalanobis distances. The first of these refers to the fitting of a
112
 
multivariate normal distribution, a standard statistical procedure; 
113
 
the second panel gives the corresponding QQ-plot of suitable Mahalanobis 
114
 
distances for the multivariate skew-normal fit.
115
 
 
116
 
The third plot is similar to the previous one, except that PP-plots
117
 
are produced.
118
 
}
119
 
\details{
120
 
For computing the maximum likelihood estimates, \code{mst.fit}
121
 
invokes \code{mst.mle}, while \code{mst.fit} displays the results
122
 
in graphical form.
123
 
See the documentation of \code{mst.mle} for details of the numerical
124
 
procedure for maximum likelihood estimation.
125
 
}
126
 
\note{
127
 
  This function may be removed in future versions of the package, and
128
 
  (some of) its functionality transferred somewhere else
129
 
  }
130
 
\section{Background}{
131
 
The family of multivariate skew-t distributions is an extension of the 
132
 
multivariate Student's t family, via the introduction of a \code{shape} 
133
 
parameter which regulates skewness; when \code{shape=0}, the skew-t 
134
 
distribution reduces to the regular symmetric \emph{t}-distribution. 
135
 
When \code{df=Inf} the distribution reduces to the multivariate skew-normal 
136
 
one; see \code{dmsn}. See the reference below for additional information.
137
 
}
138
 
\references{
139
 
Azzalini, A. and Capitanio, A. (2003).
140
 
  Distributions generated by perturbation of symmetry 
141
 
  with emphasis on a multivariate skew \emph{t} distribution.
142
 
 \emph{J.Roy. Statist. Soc. B} \bold{65}, 367--389.
143
 
 
144
 
}
145
 
\seealso{
146
 
\code{\link{mst.mle}}, \code{\link{msn.fit}}, \code{\link{dmst}}, \code{\link{dmsn}}
147
 
}
148
 
\examples{
149
 
data(ais, package="sn")
150
 
attach(ais)
151
 
# a simple-sample case
152
 
b <- mst.fit(y=cbind(Ht,Wt))
153
 
#
154
 
# a regression case:
155
 
a <- mst.fit(X=cbind(1,Ht,Wt), y=bmi)
156
 
#
157
 
# refine the previous outcome
158
 
a1 <- mst.fit(X=cbind(1,Ht,Wt), y=bmi, start=a$dp)
159
 
}
160
 
\keyword{distribution}
161
 
\keyword{regression}