inv_GMI: function to compute a vector of joint probabilities from a...

Description Usage Arguments Value See Also Examples

Description

Given an hmmm model and the vector of its generalized interactions eta, the vector of joint probabilities p is computed by inverting eta=C*ln(M*p)

Usage

1
inv_GMI(etpar, mod, start = rep(0, prod(mod$modello$livelli)))

Arguments

etpar

Vector of gmi

mod

hmmm model corresponding to etapar; an object of class hmmmod created by hmmm.model

start

Starting values for log-linear parameters in the non linear equations problem

Value

Vector of joint probabilities

See Also

GMI, hmmm.model

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# a joint distribution of 2 variables with 4 categories each

p4<-c(
0.0895, 0.0351 ,0.0004, 0.0003, 
0.0352, 0.2775, 0.0619, 0.0004, 
0.0004, 0.0620, 0.2775, 0.0351, 
0.0001, 0.0004, 0.0352, 0.089)

marg<-marg.list(c("l-m","m-l","l-l"), mflag="m") 
labelrisp<-c("R1","R2")
modello<-hmmm.model(marg=marg,lev=c(4,4),names=labelrisp)

etpar<-GMI(c(p4),c("l-m","m-l","l-l"),c(4,4),labelrisp,mflag="m")
etpar$gmi
p4rec<-inv_GMI(etpar$gmi,modello)
P<-cbind(p4rec,c(p4),c(p4)-p4rec)
colnames(P)<-c("prob","prob from eta","check")
P

hmmm documentation built on May 2, 2019, 12:27 p.m.