[FLR-list] Adding a segregAR1 in FLSR

Mark Payne mpa at aqua.dtu.dk
Mon Oct 14 08:49:03 CEST 2013


Hi,

I'm trying to define a segregAR1 FLSR model, as it seems to be missing from the SRmodels available in FLCore. I have modified the segreg model as follows, based on the bevholtAR1 and rickerAR1 models:

#SegregAR1
segregAR1 <- function(){
    logl <- function(a, b, rho, rec, ssb){
       loglAR1(log(rec), FLQuant(log(ifelse(c(ssb)<=b,a*c(ssb),a*b)),dimnames=dimnames(ssb)),rho=rho)}

    model <- rec ~ FLQuant(ifelse(c(ssb)<=b,a*c(ssb),a*b),dimnames=dimnames(ssb))

    initial <- structure(function(rec, ssb){
      return(FLPar(a=median(c(rec/ssb),na.rm=TRUE), b=median(c(ssb),na.rm=TRUE)))},
      lower=rep( 0, 0),
      upper=rep(Inf, 2))

return(list(logl=logl, model=model, initial=initial))
} # }}}


Basically, I've justed added a rho parameter to the likelihood which should, as I understand it, be sufficient to give me what I want. However, it doesn't seem to work when I go to fit it:
> model(base.dat) <- "segregAR1"
> res <- fmle(base.dat)
  Nelder-Mead direct search function minimizer
Error in .local(obs, hat, ...) :
  argument "rho" is missing, with no default
>

Any ideas what I've done wrong?

Mark







________________________________
Fra: flr-list-bounces at r-forge.wu-wien.ac.at [flr-list-bounces at r-forge.wu-wien.ac.at] på vegne af Luis Ridao [luridao at gmail.com]
Sendt: 4. oktober 2013 16:08
Til: flr-list at flr-project.org
Emne: [FLR-list] FLBRP<2 sorce code

FLR help,

trying to get the source code for FLBRP version<2 (e.g. FLBRP_1.4-1)
but can't find it anywhere.

anyone with an older source code version of the package around?

best,
Luis


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/flr-list/attachments/20131014/14e2c815/attachment.html>


More information about the flr-list mailing list