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

« back to all changes in this revision

Viewing changes to man/sn.mle.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{sn.mle}
2
 
\alias{sn.mle}
3
 
\title{
4
 
Maximum likelihood estimation for skew-normal models
5
 
}
6
 
\description{
7
 
Fits a skew-normal (SN) distribution to data, or fits a linear regression
8
 
model with skew-normal errors, using maximum likelihood estimation.
9
 
}
10
 
\usage{
11
 
sn.mle(X, y, cp, plot.it=TRUE, trace=FALSE, method="L-BFGS-B",
12
 
          control=list(maxit=100))
13
 
}
14
 
\arguments{
15
 
\item{y}{
16
 
a vector contaning the observed variable. This is the response
17
 
variable in case of linear regression.
18
 
Missing values (\code{NA}s) are not allowed.
19
 
}
20
 
\item{X}{
21
 
  a matrix of explanatory variables.
22
 
  If \code{X} is missing, then a one-column matrix of all 1's is created.
23
 
  If \code{X} is supplied, then it must include a column of 1's.
24
 
  Missing values (\code{NA}s) are not allowed.
25
 
}
26
 
\item{cp}{
27
 
a vector of initial values for the centred parameters,
28
 
with \code{length(cp)=ncol(X)+2}
29
 
}
30
 
\item{plot.it}{
31
 
logical value, If \code{plot.it=TRUE} (default),
32
 
a plot of the nonparametric estimate of variable \code{y} (or the residuals,
33
 
in the case of regression), and the parametric fit is superimposed.
34
 
See below for details.
35
 
}
36
 
\item{trace}{
37
 
logical value which controls printing of the algorithm convergence.
38
 
If \code{trace=TRUE}, details are printed. Default value is \code{FALSE}.
39
 
}
40
 
\item{method}{
41
 
this parameter is just passed to the optimizer \code{optim}; see the 
42
 
documentation of this function for its usage. Default value is 
43
 
\code{"L-BFGS-B"}.}
44
 
\item{control}{
45
 
this parameter is just passed to the optimizer \code{optim}; 
46
 
see the documentation of this function for its usage.
47
 
}}
48
 
\value{
49
 
a list containing the following components:
50
 
 
51
 
\item{call}{
52
 
a string containing the calling statement
53
 
}
54
 
\item{cp}{
55
 
a vector of length \code{ncol(X)+2} with the centred parameters
56
 
}
57
 
\item{logL}{
58
 
the log-likelihood at convergence
59
 
}
60
 
\item{se}{
61
 
a vector of standard errors for the \code{cp} component
62
 
}
63
 
\item{info}{
64
 
the observed information matrix for the \code{cp} component
65
 
}
66
 
\item{optim}{
67
 
the list returned by the optimizer \code{optim}; see the documentation
68
 
of this function for explanation of its components.
69
 
}}
70
 
\section{Side Effects}{
71
 
If \code{plot.it=TRUE} and a graphical device is active, a plot is produced,
72
 
as described above.
73
 
}
74
 
\details{
75
 
The optimizer \code{optim} is used, supplying the gradient of the log-likelihood.
76
 
Convergence is generally fast and reliable, but inspection of
77
 
the returned \code{message} from \code{optim} is always appropriate.
78
 
In suspect cases, re-run the function changing the starting \code{cp}
79
 
vector.
80
 
 
81
 
If plotting operates, the function \code{sm.density} of the package \code{sm}
82
 
is searched; this library is associated with the book by Bowman and
83
 
Azzalini (1997).  If \code{sm.density} is not found, an histogram is plotted.
84
 
 
85
 
To fit a skew-normal distribution to grouped data by exact maximum likelihood
86
 
estimation, use \code{sn.mle.grouped}.
87
 
 
88
 
}
89
 
\section{Background}{
90
 
Background information on the SN distribution is given by Azzalini (1985).
91
 
See also Azzalini and Capitanio (1999), for an additional discussion of
92
 
the centred parametrization.
93
 
}
94
 
\references{
95
 
Azzalini, A. (1985).
96
 
A class of distributions which includes the normal ones.
97
 
\emph{Scand. J. Statist.}
98
 
\bold{12}, 171-178.
99
 
 
100
 
 
101
 
Azzalini, A. and Capitanio, A. (1999).
102
 
Statistical applications of the multivariate skew-normal distribution.
103
 
\emph{J.Roy.Statist.Soc. B}
104
 
\bold{61}, 579--602.
105
 
 
106
 
 
107
 
Bowman, A.W. and Azzalini, A. (1997).
108
 
\emph{Applied Smoothing Techniques for Data Analysis:}
109
 
\emph{the Kernel Approach with S-Plus Illustrations.}
110
 
Oxford University Press, Oxford.
111
 
}
112
 
\seealso{
113
 
\code{\link{dsn}}, \code{\link{sn.em}}, \code{\link{msn.mle}},
114
 
\code{\link{optim}}, \code{\link{sn.mmle}}, \code{\link{sn.mle.grouped}}
115
 
}
116
 
\examples{
117
 
data(ais, package="sn")
118
 
attach(ais)
119
 
a<-sn.mle(y=bmi)
120
 
#
121
 
a<-sn.mle(X=cbind(1,lbm),y=bmi)
122
 
#
123
 
b<-sn.mle(X=model.matrix(~lbm+sex), y=bmi)
124
 
}
125
 
\keyword{regression}
126
 
\keyword{distribution}