[FLR-list] Initialising an FLSR

Iago MOSQUEIRA (JRC) iago.mosqueira-sanchez at jrc.ec.europa.eu
Fri Oct 18 14:59:09 CEST 2013


On 10/18/2013 02:51 PM, Mark Payne wrote:
> Hi,
> 
> Cheers for the reply. I have tried that, but it doesn't actually speed it up! eg
> 
> #Without initialisation
> system.time(fmle(nsher))  
>  user  system elapsed 
>   8.444   0.084   8.928 
> 
> #With correct initial guesses
> system.time(fmle(nsher, start=params(nsher)))
>   user  system elapsed 
>   8.121   0.060   8.675 
> 
> But there may be something wierd with the dispatching - I get this warning to start with
> 
>> system.time(fmle(nsher, start=params(nsher)))
> Note: method with signature ‘FLModel#FLPar’ chosen for function ‘fmle’,
>  target signature ‘FLSR#FLPar’.
>  "FLSR#ANY" would also be valid
> 
> Mark

Hi,

Well, not passing start means you get the initial parameter values from
a call to the function stored in @initial, which it the case of ricker
gives results already very close, so the optimizer does equally well.

I do not get any warning using the very latest FLCore on R 3.0, are you
on the development version from github too?

I run a quick check before replying, to make sure optim was being passed
the new values, and that seems to be the case.

Some quick timings

# with initial
system.time(fmle(nsher))

   user  system elapsed
  2.840   0.004   2.849


# with fitted
system.time(fmle(nsher, start=params(nsher)))

   user  system elapsed
  2.996   0.000   3.002

# with bad initial values
params(nsher)[] <- c(1,1)
system.time(fmle(nsher, start=params(nsher)))

   user  system elapsed
  7.345   0.016   7.373




Iago

> 
> 
> ________________________________________
> Fra: flr-list-bounces at r-forge.wu-wien.ac.at [flr-list-bounces at r-forge.wu-wien.ac.at] på vegne af Iago MOSQUEIRA (JRC) [iago.mosqueira-sanchez at jrc.ec.europa.eu]
> Sendt: 18. oktober 2013 14:43
> Til: flr-list at flr-project.org
> Emne: Re: [FLR-list] Initialising an FLSR
> 
> On 10/18/2013 02:27 PM, Mark Payne wrote:
>> Hi,
>>
>> I have an FLSR object that I have fitted. I now wish to use these parameters as the initial conditions for fitting a second FLSR, based on similar but slightly different data. What's the best way to do this?
>>
>> The @initial slot seems to need a function, which I wasn't expecting... Can I feed the FLPar object to fmle for example?
>>
>> Cheers,
>>
>> Mark
> 
> Hi,
> 
> This should do it, use the start argument
> 
> library(FLCore)
> 
> data(nsher)
> 
> params(nsher)
> 
> out <- fmle(nsher, start=params(nsher))
> 
> 
> 
> Iago
> 
> 
> --
> Dr Iago Mosqueira
> 
> European Commission – Joint Research Center
> Institute for the Protection and Security of the Citizen (IPSC)
> Maritime Affairs Unit FISHREG – Scientific Support to Fisheries
> TP 051, Via Enrico Fermi 2749
> I-21027 Ispra (VA), Italy
> 
> Office : +39 0332 785413
> Fax: +39 0332 789658
> 
> iago.mosqueira at jrc.ec.europa.eu
> 
> http://fishreg.jrc.ec.europa.eu/home
> 
> _______________________________________________
> flr-list mailing list
> flr-list at flr-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/flr-list
> _______________________________________________
> flr-list mailing list
> flr-list at flr-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/flr-list
> 


-- 
Dr Iago Mosqueira

European Commission – Joint Research Center
Institute for the Protection and Security of the Citizen (IPSC)
Maritime Affairs Unit FISHREG – Scientific Support to Fisheries
TP 051, Via Enrico Fermi 2749
I-21027 Ispra (VA), Italy

Office : +39 0332 785413
Fax: +39 0332 789658

iago.mosqueira at jrc.ec.europa.eu

http://fishreg.jrc.ec.europa.eu/home



More information about the flr-list mailing list