Learn R Programming

MMDai (version 0.1.0)

JointDistribution: Joint distribution

Description

This function is used to compute joint distribution given the estimates of theta and psi.

Usage

JointDistribution(theta, psi, input)

Arguments

theta
- a vector that sum to 1, denotes probability of latent class.
psi
- an array with dimension c(k,p,d), specific probability for each variables in each component.
input
- a p-dimensional vector denote specific variable, e.g., assume p=2, input = (1,2) means the joint probability of V_1=1 and V_2=2.

Examples

Run this code
k<-2; p<-2; d<-2;
theta<-c(0.3,0.7)
psi <- array(rdirichlet(k*p,rep(1,d)),dim = c(k,p,d))
JointDistribution(theta,psi,input = c(1,1))

Run the code above in your browser using DataLab