Displaying 3 results from an estimated 3 matches for "llmnl".
Did you mean:
llmnr
2005 Aug 19
1
How to create design matrix for LLMNL?
Hello,
I have a small problem with developing design matrix X, which I use in
estimation the log-likelihood of a multinomial logit model.
I have the data:
number of observation - 289
number of choice alternative- 3
number of choice specific variables in matrix X -4
matrix X =289x4
I tried to use the function createX, I know that I have to get design matrix
289x12 (am I right?) but
2006 Aug 02
1
RE
...1 0.5433642 -0.5433642 0.2952447
[9,] 0 0 13.1461040 -13.1461040 172.8200512
In the above example my X matrix as you can see has 3 columns with 3
observations, which now in XD are 9 observations in 3rd column, I don't know
how col 4 and col 5 of XD play a role in computing the llmnl and
rmnlIndepMetrop.
Thanks for all your help and time.
Regards,
Murthy.
2005 May 19
1
R 2.1.0 RH Linux Built from Source Segmentation Fault
...(floor(R/keep)*nvar),ncol=nvar)
#
# compute required quantities for indep candidates
#
oldbeta=beta0
mhess=diag(nvar)
candcov=chol2inv(chol(mhess))
root=s*chol(candcov)
priorcov=chol2inv(chol(A))
rootp=chol(priorcov)
rootpi=backsolve(rootp,diag(nvar))
#
# start main iteration loop
#
oldlpost=llmnl(y,X,beta0)+lmvn(beta0,betabar,rootpi)
naccept=0
for (rep in 1:R)
{
betac=oldbeta+t(root)%*%rnorm(nvar)
clpost=llmnl(y,X,betac)+lmvn(betac,betabar,rootpi)
ldiff=clpost-oldlpost
alpha=min(1,exp(ldiff))
if(alpha < 1) {unif=runif(1)} else {unif=0}
if (unif <= alpha)...