Learn R Programming

MitISEM (version 1.2)

Mvgt: General student t distribution

Description

Density and random generation for the general studen t distribution

Usage

dmvgt(theta, mit = list(), log=TRUE)
rmvgt(N,mit)

Arguments

theta

Vector of lenght \(N\) or \(N\times k\) matrix of quantiles. If theta is a matrix, each row is taken to be a quantile.

N

number of observations

mit

list defining the mixture components. See isMit for how it should be defined.

log

logical; if TRUE (default), probabilities p are given as \(\ln(p)\).

Value

dmvgt returns vector of size N with density values for each row of theta

rmvgt returns an \(N\times k\) matrix of draws from the \(k\)-variate mixture of student t densities

See Also

isMit

Examples

Run this code
# NOT RUN {
  H      <- 2
  p      <- runif(H)
  p      =  p / sum(p) 
  mu     <- matrix(seq(1:H),H,1)
  Sigma  <- matrix(runif(H^2),H,H)
  df     <- seq(1:H)  
  Ndraws <- rmvgt(N=10,mit=list(p=p,mu=mu,Sigma=Sigma,df=df))
  pdraws <- dmvgt(theta=Ndraws,mit=list(p=p,mu=mu,Sigma=Sigma,df=df))
# }

Run the code above in your browser using DataLab