<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">You need to add the initial params and
      bounds also.<br>
      <br>
      bevholtAR1 <- function()<br>
        {<br>
        ## log likelihood, assuming normal log.<br>
        logl <- function(a, b, rho, rec, ssb)<br>
            loglAR1(log(rec), log(a*ssb/(b+ssb)), rho=rho)<br>
      <br>
        ## initial parameter values<br>
        initial <- structure(function(rec, ssb) {<br>
            a <- max(quantile(c(rec), 0.75, na.rm = TRUE))<br>
          b <- max(quantile(c(rec)/c(ssb), 0.9, na.rm = TRUE))<br>
          return(FLPar(a = a, b = a/b, rho=0))<br>
          },<br>
      <br>
        ## bounds<br>
        lower=c(rep(10e-8, 2), -1),<br>
          upper=c(rep(Inf, 2), 1))<br>
      <br>
        ## model to be fitted<br>
        model  <- rec~a*ssb/(b+ssb)<br>
        <br>
          return(list(logl=logl, model=model, initial=initial))<br>
      } # }}}<br>
      <br>
      <br>
      i.e.  <br>
           initial <- structure(function(rec, ssb){<br>
            return(FLPar(a=median(c(rec/ssb),na.rm=TRUE),
      b=median(c(ssb),na.rm=TRUE),rho=0.0))},<br>
            lower=c( 0, 0,-1),<br>
            upper=c(Inf,Inf,1))<br>
      <br>
      <br>
      On 14/10/13 08:49, Mark Payne wrote:<br>
    </div>
    <blockquote
cite="mid:F94133E16E08E04D8D83797785A94EA218891E@ait-pex02mbx05.win.dtu.dk"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
      <div style="direction: ltr;font-family: Tahoma;color:
        #000000;font-size: 10pt;">Hi,<br>
        <br>
        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:<br>
        <br>
        #SegregAR1<br>
        segregAR1 <- function(){<br>
            logl <- function(a, b, rho, rec, ssb){<br>
               loglAR1(log(rec),
FLQuant(log(ifelse(c(ssb)<=b,a*c(ssb),a*b)),dimnames=dimnames(ssb)),rho=rho)}<br>
                           <br>
            model <- rec ~
        FLQuant(ifelse(c(ssb)<=b,a*c(ssb),a*b),dimnames=dimnames(ssb))<br>
        <br>
            initial <- structure(function(rec, ssb){<br>
              return(FLPar(a=median(c(rec/ssb),na.rm=TRUE),
        b=median(c(ssb),na.rm=TRUE)))},<br>
              lower=rep( 0, 0),<br>
              upper=rep(Inf, 2))<br>
        <br>
        return(list(logl=logl, model=model, initial=initial))<br>
        } # }}}<br>
        <br>
        <br>
        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:<br>
        > model(base.dat) <- "segregAR1"<br>
        > res <- fmle(base.dat)<br>
          Nelder-Mead direct search function minimizer<br>
        Error in .local(obs, hat, ...) : <br>
          argument "rho" is missing, with no default<br>
        > <br>
        <br>
        Any ideas what I've done wrong?<br>
        <br>
        Mark<br>
        <br>
        <br>
        <br>
        <div class="line" id="LC76"><span class="c1"><br>
          </span></div>
        <br>
        <br>
        <br>
        <div style="font-family: Times New Roman; color: #000000;
          font-size: 16px">
          <hr tabindex="-1">
          <div style="direction: ltr;" id="divRpF64123"><font
              color="#000000" face="Tahoma" size="2"><b>Fra:</b>
              <a class="moz-txt-link-abbreviated" href="mailto:flr-list-bounces@r-forge.wu-wien.ac.at">flr-list-bounces@r-forge.wu-wien.ac.at</a>
              [<a class="moz-txt-link-abbreviated" href="mailto:flr-list-bounces@r-forge.wu-wien.ac.at">flr-list-bounces@r-forge.wu-wien.ac.at</a>] på vegne af Luis
              Ridao [<a class="moz-txt-link-abbreviated" href="mailto:luridao@gmail.com">luridao@gmail.com</a>]<br>
              <b>Sendt:</b> 4. oktober 2013 16:08<br>
              <b>Til:</b> <a class="moz-txt-link-abbreviated" href="mailto:flr-list@flr-project.org">flr-list@flr-project.org</a><br>
              <b>Emne:</b> [FLR-list] FLBRP<2 sorce code<br>
            </font><br>
          </div>
          <div>
            <div dir="ltr">
              <div>
                <div>
                  <div>
                    <div>
                      <div>FLR help,<br>
                        <br>
                      </div>
                      trying to get the source code for FLBRP
                      version<2 (e.g. FLBRP_1.4-1)<br>
                    </div>
                    but can't find it anywhere.<br>
                    <br>
                  </div>
                  anyone with an older source code version of the
                  package around?<br>
                  <br>
                </div>
                best,<br>
              </div>
              Luis<br clear="all">
              <div>
                <div>
                  <div>
                    <div>
                      <div>
                        <div>
                          <div>
                            <div><br>
                              <br>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
flr-list mailing list
<a class="moz-txt-link-abbreviated" href="mailto:flr-list@flr-project.org">flr-list@flr-project.org</a>
<a class="moz-txt-link-freetext" href="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</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>