Description Usage Arguments Value See Also Examples
View source: R/rvinebvndiscnllk.R
Negative log-likelihood for discrete R-vine with Gaussian pair-copulas and ordinal response
1 2 | rvinediscbvnnllk(parvec,zzdat,A) # univariate margins converted to zzdat
rvinediscbvnfullnllk(parvec,A,xmat,yvec,nrep,ncateg) # full max likelihood
|
parvec |
parameter vector of partial correlations with length d*(d-1)/2 |
zzdat |
dimension nclx(2d) with corners of rectangle , N(0,1) scale |
A |
dxd vine array with 1:d on diagonal |
xmat |
nn*npred matrix, nn=nrep*ncl=d*ncl, ncl=#clusters |
yvec |
integer-valued vector of length nn, values in 0:(ncateg-1) or 1:ncateg |
nrep |
cluster size d or #repeated ordinal measures |
ncateg |
number of ordinal categories |
negative log-likelihood
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | data(ordinalex)
xvec=c(t(ordinalex$xx))
yvec=c(t(ordinalex$yy))
uni=ordprobit.univar(xvec,yvec,iprint=FALSE)
latentdat=mord2uu(xvec,yvec,nrep=4,uni$cutpts,uni$beta)
uudat=latentdat$uudat
zzdat=latentdat$zzdat
D4=Dvinearray(4)
param=c(.5,.5,.5,.1,.1,.1)
temz=rvinediscbvnnllk(param,zzdat,D4)
print(temz)
mlz=nlm(rvinediscbvnnllk,p=param,zzdat=zzdat,A=D4,hessian=TRUE,print.level=1)
fparam=c(uni$cutpts,uni$beta, mlz$estimate)
fnllk=rvinediscbvnfullnllk(fparam,D4,xvec,yvec,nrep=4,ncateg=3)
print(fnllk)
fnllk2=rvinediscbvnfullnllk(fparam,D4,xvec,yvec-1,nrep=4,ncateg=3)
print(fnllk2)
mlf=nlm(rvinediscbvnfullnllk,fparam,A=D4,xmat=xvec,yvec=yvec,nrep=4,ncateg=3,
hessian=TRUE,print.level=1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.