[Limdep Nlogit List] Error 185 using Krinsky and Robb bootstrapping method

David Hensher D.Hensher at econ.usyd.edu.au
Tue Apr 5 11:26:35 AEST 2016

Try as an example (From ACA book second edition)
    U(NLRail)= NLRAsc + cost*tcost + invt*InvTime + acwt*waitt+
    acwt*acctim + accbusf*accbusf+eggT*egresst
                         + ptinc*pinc + ptgend*gender + NLRinsde*inside /
    U(NHRail)= TNAsc + cost*Tcost + invt*InvTime + acwt*WaitT + acwt*acctim
    + eggT*egresst + accbusf*accbusf
                  + ptinc*pinc + ptgend*gender + NHRinsde*inside /
    U(NBway)=  NBWAsc + cost*Tcost + invt*InvTime + waitTb*WaitT + accTb*acctim
    + eggT*egresst + accbusf*accbusf+ ptinc*pinc + ptgend*gender /
    U(Bus)=    BSAsc + cost*frunCost + invt*InvTime + waitTb*WaitT + accTb*acctim
    + eggT*egresst+ ptinc*pinc + ptgend*gender/
    U(Bway)=   BWAsc + cost*Tcost + invt*InvTime + waitTb*WaitT + accTb*acctim
    + eggT*egresst + accbusf*accbusf+ ptinc*pinc + ptgend*gender /
    U(Train)=  TNAsc + cost*tcost + invt*InvTime + acwt*WaitT + acwt*acctim
    + eggT*egresst + accbusf*accbusf+ ptinc*pinc + ptgend*gender /
    U(Car)=    CRcost*costs + CRinvt*InvTime + CRpark*parkcost + CReggT*egresst$
?K and R:
wald ; parameters = b ; labels  = 20_c,ivpt,ivcar
    ; covariance = varb
    ; fn1 = ivpt-1 ; fn2 = ivcar - 1 ; k&r ; pts=500 $

DAVID HENSHER FASSA| Professor and Founding Director
Institute of Transport and Logistics Studies | The University of Sydney Business School

Rm 201, H73| The University of Sydney | NSW | 2006
Street Address: 378 Abercrombie St., Darlington  NSW 2008

T +61 2 9114 1871 | F +61 2 9114 1722 | M +61 418 433 057
E David.Hensher at sydney.edu.au | W http://sydney.edu.au/business/itls
My contact details have changed, please update your records.
Celebrating 21 years of ITLS: 1991-2012
ERA Rank 5 (Transportation and Freight Services)

From: limdep-bounces at limdep.itls.usyd.edu.au [limdep-bounces at limdep.itls.usyd.edu.au] on behalf of Nathan P. Kemper [nkemper at uark.edu]
Sent: Tuesday, 5 April 2016 11:07 AM
To: limdep at limdep.itls.usyd.edu.au
Subject: [Limdep Nlogit List] Error 185 using Krinsky and Robb bootstrapping    method


I am having trouble using the K&R method to generate a distribution of WTP estimates for some of my models.  Currently we are examining any differences in WTP between 5 groups.  Each group as about 500 respondents and I can use the commands below to generate WTP distributions of 1,000 estimates for 2 of my 5 groups.  However, when I run the ECLOGIT models for 3 of the groups then proceed to using the K&R method I receive the following error:

Error    185: MATRIX - GINV,SINV,CHOL  singular, not P.D. if SINV or CHOL

I have searched and searched and cannot figure out what is wrong with either my commands or my models.  The models and commands are replicates of group (cell) 5 which works perfectly and happens to be our experimental control.  The only differences are my "cell=" or "reject" commands that change with treatment.  Can anyone help me identify the source of this error and a possible solution or work around?  I know there are other methods of generating distributions of WTP estimates but I'm baffled as to why this one won't work.  At least to me there are not obvious big errors in the data coding or the commands.

The culprit seems to be the following line:

matrix; b_gm_i= Rndm(B,VARB)$

When run by itself the following error returns:

Error    185: MATRIX - GINV,SINV,CHOL  singular, not P.D. if SINV or CHOL

And when I run all the commands at once I get to see this error 1,000 times over!!!! And I get 1,000 WTP estimates that are identical and equal to the mean.  Here is the code for the second of seven variables in a ECLOGIT model where "price" and "none" are fixed and the other variables are random:

matrix; b_gm_i= Rndm(B,VARB)$
matrix; wtp_gmi={(-b_gm_i(2))/(b_gm_i(7))}$
matrix; wtp_gm(gm_i,*)= wtp_gmi$

calc; kr_ngm=1000$
matrix; wtp_gm=init(kr_ngm,1,0)$
execute; procedure=kr_wtp;gm_i=1,kr_ngm;silent$

sample; 1-kr_ngm$
create; vwtp_gm1=wtp_gm$
dstat; Rhs=vwtp_gm1$
calc; list; wtp_med=med(vwtp_gm1)$
calc; list; wtp_low=qnt(vwtp_gm1,0.025)$
calc; list; wtp_high=qnt(vwtp_gm1,0.975)$


In the event that it is helpful, the RPL-ec commands are as follows (which I run just prior to the above K&R commands):

sample; all$
ECLOGIT; IF [cell=1];
    Choices=PRODA, PRODB, NONE;
    Pts= 250;
    FCN= bng(n),bgm(n),blo(n),bmd(n),bhi(n),blc(n);
    PDS = 8;
    U (PRODA)=bprice*price+bng*ng+bgm*gm+blo*lo+bmd*md+bhi*hi+blc*lc/
    U (PRODB)=bprice*price+bng*ng+bgm*gm+blo*lo+bmd*md+bhi*hi+blc*lc/
    U (NONE)=bnone*none;

Thank you in advance for any guidance or advice on this problem.


Nathan Kemper
Limdep site list
Limdep at limdep.itls.usyd.edu.au

More information about the Limdep mailing list