[ADMB Users] Are parameters scaled for optimization.
dave fournier
davef at otter-rsch.com
Wed Jan 1 15:35:30 PST 2014
On 14-01-01 01:43 PM, Mark Maunder wrote:
for an unbounded parameter (an init_number)
the scalefactor is implmented OK.
238 void df1b2_init_number::set_value(const init_df1b2vector& _x,const
int& _ii,
239 const df1b2variable& pen)
240 {
241 ADUNCONST(init_df1b2vector,x)
242 ADUNCONST(int,ii)
243 if (scalefactor==0.0)
244 operator = (x(ii++));
245 else
246 operator = (x(ii++)/scalefactor);
247 }
248
So this is OK.
However the code for an init_bounded_vector never wrote itself.
569 void df1b2_init_bounded_vector::set_value(const init_df1b2vector& _x,
570 const int& ii,const df1b2variable& pen)
571 {
572 init_df1b2vector& x=(init_df1b2vector&) _x;
573 if (initial_params::mc_phase)
574 {
575 ::set_value_mc(*this,x,ii,minb,maxb);
576 }
577 else
578 {
579 ::set_value(*this,x,ii,minb,maxb,pen);
580 }
I was hoping that someone would take up the job after the
init_bounded_number was done,
but there seems to be more interest in doxygen and unbelievably
complicated script files.
If there is some interest I can extend this a bit. One application
would be to multivariate
random effects models. It appears that scaling the std dev terms
greatly improves the stability of
glmmadmb and I expect this is a fairly general result.
> I assume it is the same for standard parameters and re parameters.
I'm not sure what is meant here.
Dave
> Thanks Dave. What if it is unbounded? I assume it is the same for standard parameters and re parameters.
>
> Regards,
>
> Mark
> IATTC
>
>> On Dec 31, 2013, at 1:03 PM, "dave fournier" <davef at otter-rsch.com> wrote:
>>
>>
>> For a random effects model
>> The relevant code appears to be
>>
>> if the scalefactor has not been set (i.e. =0)
>>
>> 409 df1b2variable boundp(const df1b2variable& x, double fmin, double fmax,
>> 410 const df1b2variable& _fpen)
>> 411 {
>> 412 ADUNCONST(df1b2variable,fpen)
>> 413 df1b2variable t;
>> 414 //df1b2variable y;
>> 415 //y=x;
>> 416 double diff=fmax-fmin;
>> 417 const double l4=log(4.0);
>> 418 df1b2variable ss=0.49999999999999999*sin(x*1.57079632679489661)+0.50;
>> 419 t=fmin + diff*ss;
>> 420
>>
>> So the parameter is effectively scaled by diff.
>> Better would be
>>
>> 418 df1b2variable ss=0.49999999999999999*sin(x/diff*1.57079632679489661)+0.50;
>>
>> The only difficulty would be that the function minimizer report does not deal with large numbers well.
>>
>> For parameters whose scalefactor has been set the code is
>>
>>
>> 460 df1b2variable boundp(const df1b2variable& _x, double fmin, double fmax,
>> 461 const df1b2variable& _fpen,double s)
>> 462 {
>> 463 ADUNCONST(df1b2variable,fpen)
>> 464 df1b2variable t;
>> 465 df1b2variable x=_x/s;
>> 466 //df1b2variable y;
>> 467 //y=x;
>> 468 double diff=fmax-fmin;
>> 469 const double l4=log(4.0);
>> 470
>> 471 // ss is underlying varialbe on [0,1] and t lives in [fmin,fmax]
>> 472 df1b2variable ss=0.49999999999999999*sin(x*1.57079632679489661)+0.50;
>> 473 t=fmin + diff*ss;
>> 474
>>
>> again
>>
>> 472 df1b2variable ss=0.49999999999999999*sin(x/diff*1.57079632679489661)+0.50;
>>
>> would be better.
>>
>> I wrote a note about this earlier, but it did not generate much interest.
>>
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at admb-project.org
>> http://lists.admb-project.org/mailman/listinfo/users
More information about the Users
mailing list