I'm getting an error on the line where I used to be able to allocate a 3d ragged array.
This is the error
pond.cpp:765: error: no matching function for call to 'df1b23array::allocate(int, data_int&, int, data_int&, int, data_ivector&, const char [11])'
This is the line in the cpp file
tk_minus_b.allocate(1,nponds,1,ndays,1,nobs,"tk_minus_b");
This seems to be the line in the tpl file
3darray tk_minus_b(1,nponds,1,ndays,1,nobs)//(p,b,k)
nobs is an ivector with length=nponds
Are ragged arrays not available with random effects?
thanks,
Mollie
Mollie Brooks
Ph.D. Candidate
NSF IGERT Fellow
Biology Department
University of Florida
mbr...@ufl.edu
http://people.biology.ufl.edu/mbrooks
_______________________________________________
Users mailing list
Us...@admb-project.org
http://lists.admb-project.org/mailman/listinfo/users
You are probably right: 3d ragged arrays are not implemented for random effects.
I have never tried, but it would be nice if things works uniformly across the
RE and non-RE versions.
Can you create a Redmine issue (my account is not working at the moment).
Hans
My redmine account also seems to not be working at the moment. Maybe redmine is broken.
Mollie
There were some problems with the redmine server. Johnoel set up an
alternative, but all the accounts were lost. I think you have to request
a membership or something.
John
--
John Sibert
Emeritus Researcher, SOEST
University of Hawaii at Manoa
Visit the ADMB project http://admb-project.org/
I had been using an object
3darray varcov(1,nponds,2,nobs,2,nobs)
to store the variance covariance matrix for the observations of all the ponds. nobs is an ivector of length nponds. I got that matrix out as varcov(p).
ALTERNATIVE 1
I tried making a large 3d array that was large enough to cover the various sizes
3darray varcov(1,nponds,2,maxobs,2,maxobs)
To access each submatrix, I tried to use the command varcov(p).sub(2,nobs(p)), but got an error that this is not defined for df1b2 arrays.
ALTERNATIVE 2
Then I tried not defining any varcov array in the parameter section. Instead, in the procedure section, I define
dvar_matrix temp_varcov(2,nobs(p));
calc_temp_varcov(p,temp_varcov); # a function to fill in the values of temp_varcov
The program stops in the middle of calc_temp_varcov without any errors. It stops on the line where I try to store a calculated value in temp_varcov(2,l). See code below. All of the calculations that go into it look fine.
I've also tried the function definition
FUNCTION void calc_temp_varcov(const int & p, dvar_matrix & temp_varcov)
FUNCTION void calc_temp_varcov(const int & p, dvar_matrix temp_varcov)
cout<<"nobs(p)="<<nobs(p)<<endl;
for(int l=2; l<=nobs(p); l++)
{
cout<<pow(rho, 2*column(tk_minus_b(p),2)(obsdates(1,p)+1,obsdates(l,p)))<<endl;
cout<<sum(pow(rho, 2*column(tk_minus_b(p),2)(obsdates(1,p)+1,obsdates(l,p))))<<endl;
temp_varcov(2,l)=sigmaSq*sum(pow(rho, 2*column(tk_minus_b(p),2)(obsdates(1,p)+1,obsdates(l,p))));
cout<<"not ok here"<<endl;
temp_varcov(l,2)=temp_varcov(2,l);
}
Any idea how to make either of these alternatives work? Or any other ideas?
thanks,
Mollie
Mollie Brooks
Ph.D. Candidate
NSF IGERT Fellow
Biology Department
University of Florida
mbr...@ufl.edu
http://people.biology.ufl.edu/mbrooks
On 8 Feb 2012, at 2:03 PM, Hans J. Skaug wrote:
> Hi,
>
> You can of course use a matrix that is large enough to "cover"
> your ragged if it is fairly homogeneous.
>
> I registered in Redmine again, so I added the issue.
>
> Hans
Mollie