Learn R Programming

MitISEM (version 1.2)

Mit: The 'mit' object

Description

Function to check if mit generalized mixture of t densities is well-defined. The mit object is designed to be used in the rest of the MitISEM package functions

Usage

isMit(mit)

Arguments

mit

an object to be tested

Value

logical, TRUE if mit definition is correct, FALSE otherwise

Details

Argument mit is a list describing the mixture of Student-t distributions with the following components:

p

vector (of length \(H\)) of mixture probabilities.

mu

matrix (of size \(H \times d\)) containing the vectors of modes (in row) of the mixture components.

Sigma

matrix (of size \(H \times d^2\)) containing the scale matrices (in row) of the mixture components.

df

vector (of length \(H\)) degree of freedom parameters for each Student-t component (double \(>0\)).

Examples

Run this code
# NOT RUN {
  # a correct Mit definition returns 'TRUE'
  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)
  isMit(mit=list(p=p,mu=mu,Sigma=Sigma,df=df))

  # an incorrect Mit definition returns 'FALSE'
  mu   = t(mu)
  isMit(mit=list(p=p,mu=mu,Sigma=Sigma,df=df))
# }

Run the code above in your browser using DataLab