File: dmsn.Rd

package info (click to toggle)
r-cran-sn 0.4-4-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 316 kB
  • sloc: makefile: 1
file content (101 lines) | stat: -rw-r--r-- 3,113 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
\name{dmsn}
\alias{dmsn}
\alias{pmsn}
\alias{rmsn}
\title{
Multivariate skew-normal distribution
}
\description{
Probability density function, distribution function and random number 
generation for the multivariate skew-normal (MSN) distribution.
}
\synopsis{
dmsn(x, xi = rep(0, length(alpha)), Omega, alpha, dp = NULL, log = FALSE) 
pmsn(x, xi = rep(0, length(alpha)), Omega, alpha, dp = NULL, ...) 
rmsn(n = 1, xi = rep(0, length(alpha)), Omega, alpha, dp = NULL) 
}
\usage{
dmsn(x, xi=rep(0,length(alpha)), Omega, alpha, log=FALSE)
dmsn(x, dp=, log=FALSE)
pmsn(x, xi=rep(0,length(alpha)), Omega, alpha, ...)
pmsn(x, dp=)
rmsn(n=1, xi=rep(0,length(alpha)), Omega, alpha)
rmsn(n=1, dp=)
}
\arguments{
\item{x}{
for \code{dmsn}, this is either a vector of length \code{d}, 
where \code{d=length(alpha)}, or a matrix with \code{d} columns, 
giving the coordinates of the point(s) where the density must 
be evaluated;
for \code{pmsn}, only a vector of length \code{d} is allowed.
}
\item{xi}{
a numeric vector of length \code{d}, or a matrix with \code{d} columns,
representing the location parameter of the distribution.
If \code{xi} is a matrix, its dimensions must agree with those of \code{x}.
}
\item{Omega}{
a positive-definite covariance matrix of dimension \code{(d,d)}.
}
\item{alpha}{
a numeric vector which regulates the shape of the density.
}
\item{dp}{
a list with three elements named \code{xi}, \code{Omega} and \code{alpha}
containing quantities as described above. If \code{dp} is specified, this
overrides the individual parameter specification. 
}
\item{n}{
a numeric value which represents the number of random vectors
to be drawn.
}
\item{log}{ 
logical; if TRUE, densities  are given as log-densities.
}
\item{...}{
additional parameters passed to \code{pmnorm}
}}
\value{
A vector of density values (\code{dmsn}), or a single probability 
(\code{pmsn}) or a matrix of random  points (\code{rmsn}).
}
\section{Background}{
The multivariate skew-normal distribution is discussed by
Azzalini and Dalla Valle (1996); the \code{(Omega,alpha)}
parametrization adopted here is the one of Azzalini and Capitanio (1999).
}
\details{
  The positive-definiteness of \code{Omega} is not tested for
  efficiency reasons. Function \code{pmsn} requires \code{pmnorm}
  from package \code{mnormt};
  the accuracy of its computation can be controlled via use of \code{...}
}
\references{
Azzalini, A. and Dalla Valle, A. (1996).
The multivariate skew-normal distribution.
\emph{Biometrika}
\bold{83}, 715--726.


Azzalini, A. and Capitanio, A. (1999).
Statistical applications of the multivariate skew-normal distribution.
\emph{J.Roy.Statist.Soc. B}
\bold{61}, 579--602.
}
\seealso{
\code{\link{dsn}},  \code{\link{dmst}}, \code{\link[mnormt]{dmnorm}}
}
\examples{
x <- seq(-3,3,length=15)
xi <- c(0.5, -1)
Omega <- diag(2)
Omega[2,1] <- Omega[1,2] <- 0.5
alpha <- c(2,-6)
pdf <- dmsn(cbind(x,2*x-1), xi, Omega, alpha)
rnd <- rmsn(10,  xi, Omega, alpha)
p1 <- pmsn(c(2,1), xi, Omega, alpha)
p2 <- pmsn(c(2,1), xi, Omega, alpha, abseps=1e-12, maxpts=10000)
}
\keyword{distribution}
\keyword{multivariate}