[Limdep Nlogit List] matrix commands

William Greene wgreene at stern.nyu.edu
Thu Jun 4 06:40:28 EST 2009


OK, to make it simple, don't transpose beta_i. I will assume beta_i
is 71x5 and XR is 5 by 710.

MATRIX ; Result = init(71,10,0) $
CALC ; i1=1 ; i2 = 10 ; i = 0 $
PROC = Extract $
? bri is row i of beta_i, a 1x5 vector.
? xri is rows 1 to 5, columns i1 to i2 of XR. a 5x10 matrix
MATRIX ; bri = beta_i(i:i,1:5) ; xri = xr(1:5,i1:i2) $
? rowi = a 1x5 times a 5x10 = a 1x10 vector.
MATRIX ; rowi = bri * xri $
? inject rowi into row i of the result matrix
MATRIX ; Result(i,*) = rowi $
CALC ; i1=i1+10 ; i2 = i1+9 $
ENDPROC $
EXEC ; Proc = Extract ; i = 1,71 $

/Bill



----- Original Message -----
From: "Andreas Drichoutis" <adrihout at aua.gr>
To: "Limdep and Nlogit Mailing List" <limdep at limdep.itls.usyd.edu.au>
Sent: Wednesday, June 3, 2009 3:25:38 PM GMT -05:00 US/Canada Eastern
Subject: Re: [Limdep Nlogit List] matrix commands

Yes, you are right that this is from a rp estimator. I changed the
dimensions in my effort to compute the product of the matrices. 
I'm trying to find the sum of the product of the beta_i's with the set of
the random parameter variables xr. The problem is that I don't want to
extract the first 10 columns for each row but the first 10 columns for the
FIRST row, the next 10 columns (i.e. columns 11 to 20) for the second row
and so on.
Is there a workaround that I am missing? How does limdep multiply the
matrices to calculate predicted probabilities in the case of a rp estimator?
Is there a way to increase the number of cells?

Andreas

-----Original Message-----
From: limdep-bounces at limdep.itls.usyd.edu.au
[mailto:limdep-bounces at limdep.itls.usyd.edu.au] On Behalf Of William Greene
Sent: Wednesday, June 03, 2009 10:15 PM
To: Limdep and Nlogit Mailing List
Subject: Re: [Limdep Nlogit List] matrix commands

If the dimensions you give below are correct, then the matrix you
are trying to compute is 71 by 710, which is well over 50,000 cells.
If the beta_i has been created by a random parameters estimator, 
however, it is probably 71 by 5, not 5 by 71. Likewise, if XR is a
set of columns in the data set, chances are, it is 710x71, not the
reverse.  In any event, the matrix product you are computing below 
is too large.  However, if your description is precisely correct,
the way to extract the first 10 elements in each row is to use only
the first 10 columnsof XR.  You can extract these with XRsub=XR(1:71,1:10).
/Bill Greene


----- Original Message -----
From: "Andreas Drichoutis" <adrihout at aua.gr>
To: limdep at limdep.itls.usyd.edu.au
Sent: Wednesday, June 3, 2009 10:06:11 AM GMT -05:00 US/Canada Eastern
Subject: [Limdep Nlogit List] matrix commands

Dear all,
I'm using the below matrix command:
matrix ; bxr1=beta_i'xr $
where beta_i is a 5x71 matrix and xr is a 5x710 matrix. Limdep refuses to do
the multiplication with the following error: "Error   585: Matrix being
moved is too large for target."
>From the resulting matrix (71x710) I'm only interested in 10 elements from
each row i.e. I want to keep elements 1-10 from row 1, elements 11-20 from
row 2, elements 21-30 from row 3 etc and then collapse this matrix to a
71x10 matrix.

 

Does anyone know how to do that and how to get around the error message?
There must be a neat way to do it.

 

Kind regards,

Andreas Drichoutis

_______________________________________________
Limdep site list
Limdep at limdep.itls.usyd.edu.au
http://limdep.itls.usyd.edu.au
_______________________________________________
Limdep site list
Limdep at limdep.itls.usyd.edu.au
http://limdep.itls.usyd.edu.au

_______________________________________________
Limdep site list
Limdep at limdep.itls.usyd.edu.au
http://limdep.itls.usyd.edu.au



More information about the Limdep mailing list