[FLR-list] Hockey stick

Luis Ridao luridao at gmail.com
Wed Mar 21 11:08:33 CET 2012


thanks Laurie and Iago for your help

best,
Luis

On Tue, Mar 20, 2012 at 10:10 PM, Iago Mosqueira <
iago.mosqueira-sanchez at jrc.ec.europa.eu> wrote:

> On 03/21/2012 02:45 AM, Luis Ridao wrote:
>
>> FLR-help,
>>
>> I'm fitting a Hockey-stick function with following:
>>
>> fsai.segreg <- fsaiSR
>> model(fsai.segreg) <- segreg()
>> fsai.segreg <- fmle(fsai.segreg)
>>
>> and the parameter estimates are as follows:
>>
>>  > params(fsai.segreg)
>> An object of class "FLPar"
>> params
>>        a        b
>>  0.63387 45.31551
>> units:  NA
>>
>> However I want to use the parameter estimates from ADMB
>> which are something like :
>>
>> a = 0.6060456
>> b = 56.51466
>>
>> How can i set the ADMB-estimates in the 'fsai.segreg' object and
>> recalculate
>> the residuals and log-likelihood based on these estimates?
>>
>> I do something like:
>>  > model(fsai.segreg3) <- segreg(FLpar(a = exp(-0.5008), b = exp(4.0345)))
>> Error in segreg(FLpar(a = exp(-0.5008), b = exp(4.0345))) :
>>
>> and :
>>
>>  > model(fsai.segreg3) <- segreg(params=list(FLpar(a = exp(-0.5008), b =
>> exp(4.0345))))
>> Error in segreg(params = list(FLpar(a = exp(-0.5008), b = exp(4.0345)))) :
>>   unused argument(s) (params = list(FLpar(a = exp(-0.5008), b =
>> exp(4.0345))))
>>
>>
>> Thanks in advance
>>
>
> params(fasi.segreg3) <- FLPar(a = exp(-0.5008), b = exp(4.0345))
>
> should get you the parameter values into the object. Then you will have to
> calculate the estimated values residuals and get them into the fitted and
> residuals slots. For the logLik, we simply report the value returned by
> optim.
>
> Cheers,
>
>
> Iago
>
> ______________________________**_________________
> flr-list mailing list
> flr-list at flr-project.org
> https://lists.r-forge.r-**project.org/cgi-bin/mailman/**listinfo/flr-list<https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/flr-list>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/flr-list/attachments/20120321/6df3cc72/attachment-0001.html>


More information about the flr-list mailing list