isMit: The 'mit' object

Description Usage Arguments Details Value Examples

View source: R/isMit.R

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

1
isMit(mit)

Arguments

mit

an object to be tested

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 Hxd) containing the vectors of modes (in row) of the mixture components.

Sigma

matrix (of size Hx(dxd)) 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).

Value

logical, TRUE if mit definition is correct, FALSE otherwise

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
  # 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))

Example output

[1] TRUE
[1] FALSE

MitISEM documentation built on May 2, 2019, 1:57 p.m.