dskewt: Density and random number generation for multivariate skew-t...

Description Usage Arguments Details Value References Examples

View source: R/skewtmix.R

Description

dskewt gives the multivariate skew-t density, dmixskewt for a mixture of multivariate skew-t densities. rskewt draws random values from the multivariate skew-t density, rmixskewt from a mixture of multiviariate skew-t's.

Usage

1
2
3
4
5
6
7
dskewt(x,mu,Sigma,A,D,alpha,nu,param='eps',logscale=FALSE,ttype='independent')

dmixskewt(x,mu,Sigma,alpha,nu,probs,param='eps',logscale=FALSE,ttype='independent')

rskewt(n,mu,Sigma,alpha,nu,param='eps',ttype='independent')

rmixskewt(n,mu,Sigma,alpha,nu,probs,param='eps',ttype='independent')

Arguments

x

Vector, matrix or data.frame with values at which to evaluate the density

n

Number of random draws to be obtained

mu

For dskewt and rskewt mu is a vector indicating the location parameter. For dmixskewt and rmixskewt mu is a list of location parameters for each component

Sigma

For dskewt and rskewt Sigma is the scale matrix. For dmixskewt and rmixskewt it is a list of scale matrices for each component

A

Optional matrix containing eigenvectores of Sigma, i.e. Sigma= t(A) D A. For identifiability all elements in A[,1] must be positive, if any entry is negative then the corresponding row is changed sign

D

Optional diagonal matrix with eigenvalues of Sigma, i.e. Sigma= t(A) D A. For identifiability these are assumed to be in decreasing order.

alpha

For dskewt and rskewt alpha is the vector or asymmetry parameters. For dmixskewt and rmixskewt it is a list of asymmetry parameters for each component

nu

For dskewt and rskewt nu is a scalar indicating the degrees of freedom. For dmixskewt and rmixskewt nu is a list with the degrees of freedom for each component

probs

Vector with mixture component weights

param

Set to 'eps' for the epsilon-skew parametization, 'isf' for the inverse scale factor parameterization. See help(dtp3) for details

ttype

Set to 'independent' for iskew-t, to 'dependent' for dskew-t

logscale

If set to TRUE log-density is returned

Details

A draw from the iskew-t distribution is obtained as y= sqrt(D) A x, where x is a vector with independent draws from univariate t distributions.

A draw from the dskew-t distribution is obtained as y= sqrt(D) A x, where x is a draw from a multivariate t distribution with identity scale matrix. That is, the elements in x are dependent but uncorrelated, in constrast with the iskew-t where they are independent.

Value

dskewt and dmixskewt return a vector with the probability density function evaluated at the given x.

rskewt and rmixskewt return a matrix with the generated random draws.

References

Rossell D., Steel M.F.J. Continuous non-Gassian mixtures. In Handbook of Cluster Analysis, CRC Press.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#Single skew-t
library(twopiece)
n <- 100; mu1 <- c(0,0); S1 <- matrix(c(1,0,0,1),nrow=2)
alpha1 <- c(0,0); nu1 <- 100
y1 <- rskewt(n,mu=mu1,Sigma=S1,alpha=alpha1,nu=nu1,param='eps')
xseq <- seq(-3,3,length=10)
xgrid <- expand.grid(xseq,xseq)
dy1 <- dskewt(xgrid,mu=mu1,Sigma=S1,alpha=alpha1,nu=nu1)

#Mixture of skew-t's
n <- 100; probs <- c(2/3,1/3); param <- 'eps'
mu1 <- c(0,0); S1 <- matrix(c(1,0,0,1),nrow=2)
alpha1 <- c(0,0); nu1 <- 100
mu2 <- c(3,3); S2 <- matrix(c(1,.5,.5,1),nrow=2)
alpha2 <- c(-.5,0); nu2 <- 100
mu <- list(mu1,mu2); Sigma <- list(S1,S2); alpha <- list(alpha1,alpha2); nu <- list(nu1,nu2)
xsim <- rmixskewt(n,mu=mu,Sigma=Sigma,alpha=alpha,nu=nu,probs=probs,param=param)

head(xsim$x) #simulated values

head(xsim$cluster) #true cluster

twopiece documentation built on May 2, 2019, 5:32 p.m.

Related to dskewt in twopiece...