[ADMB Users] Help to optimize some code, Need for Adjoint Code
Nassar
nassar.naji at orange.fr
Thu Dec 22 05:15:35 PST 2011
Hi
I'm trying to estimate the following model.
The number of observations : 60.000
And I got the message
Wrote 4294967295 not 240000
Error writing to temporary gradient stack file: No space left on device
File name: gradfil2.tmp
File length: 0 bytes.
Attempting to write 240000 bytes; wrote 4294967295.
Thanks for your comments and help..
Naji
Environment : ADMB 10.1, 64, Microsoft SDK 7.1 64, Windows 7 64-bit and 24Go
Mem
DATA_SECTION
int nversion
!! nversion = (int) 30;
int ntask
!! ntask = (int) 7;
int noption
!! noption = (int) 6;
int takopt
!! takopt = (int) ntask*noption;
init_int nobs
init_matrix minmax(1,4,1,noption)
init_vector wgtseg(1,nobs)
!! ad_comm::change_datafile_name("prices.dat");
init_matrix prices(1,nobs,1,takopt)
!! ad_comm::change_datafile_name("available.dat");
init_matrix availa(1,nobs,1,takopt)
!! ad_comm::change_datafile_name("choices.dat");
init_matrix choice(1,nobs,1,takopt)
int o
int t
int i
int ot
PARAMETER_SECTION
init_matrix shpwtp(1,2,1,noption)
number util
number loglik
vector llik(1,nobs)
objective_function_value f
PROCEDURE_SECTION
llik=0;
for (i=1;i<=nobs;i++)
{
for (t=1;t<=ntask;t++)
{
for (o=1;o<=noption;1)
{
ot=(t-1)*noption+o;
util=shpwtp(1,o)*(shpwtp(2,o)-prices(i,ot));
loglik=choice(i,ot)*util-log(1+exp(util));
llik(i)+=availa(i,ot)*loglik;
}
}
}
f=-(wgtseg*llik);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/users/attachments/20111222/991a7d33/attachment.html>
More information about the Users
mailing list