<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt><br>
    </tt>There is a problem with indexing ages, if the ages go from 1,
    then it is OK<br>
    <br>
    <tt>load("/home/laurie/Desktop/temp/data.RData")</tt><tt><br>
    </tt><tt>ctrl <- fwdControl(data.frame(year = 0, quantity =
      "catch", val = 111111111))</tt><tt><br>
    </tt><tt>stock=stock[-1]</tt><tt><br>
    </tt><tt>res <- fwd(stock, ctrl = ctrl, sr = srr)</tt><tt><br>
    </tt><tt>catch(res)</tt><tt>[,"0"]<br>
    </tt><tt><br>
    </tt>i.e. any 1st age other than 1 causes a problem. <br>
    <br>
    Laurie<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 26/02/16 13:25, Simon Fischer
      (Cefas) wrote:<br>
    </div>
    <blockquote
cite="mid:AM3PR04MB0834174CEB63859DBFC1199BA2A70@AM3PR04MB0834.eurprd04.prod.outlook.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal">Dear all,<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">I am working on mse simulations with
          hypothetical stocks. The stocks are created from life history
          parameters which are fished at 2Fmsy until an equilibrium is
          reached. This state is then used as starting point for the
          simulations.<o:p></o:p></p>
        <p class="MsoNormal">I use fwd() to project the stock (FLStock)
          and use catch as a target. Somehow, for some stocks the catch
          predicted by fwd() differs considerably from the targeted
          catch (the actual catch is higher than the targeted catch).<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Did anyone else encounter this behaviour or
          knows how to avoid it?<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">I use the current versions of R and FLR.
          Attached to this email is a minimum reproducible example that
          shows this behaviour, the stock object and my sessionInfo().<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Thanks in advance,<o:p></o:p></p>
        <p class="MsoNormal">Simon<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Minimal reproducible example:<o:p></o:p></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">### load FLR<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">library(FLash)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">library(FLAssess)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New""><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">### load data <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">load("data.RData")<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">### contains FLStock "stock" and FLSR "srr"<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New""><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">### extend stock for 1 year<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">stock <- stf(object = stock, nyears = 1) 
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New""><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">### create fwdControl object<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">ctrl <- fwdControl(data.frame(year = 1,
            quantity = "catch", val = 111697431))<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New""><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">### fwd prediction<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">res <- fwd(stock, ctrl = ctrl, sr = srr)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New""><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">### check predicted catch<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">catch(res)[,ac(1)]<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">### 115308236 and NOT 111697431 as specified in
            the control object?<o:p></o:p></span></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">#> sessionInfo()<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">#R version 3.2.3 (2015-12-10)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">#Platform: i386-w64-mingw32/i386 (32-bit)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">#Running under: Windows 7 x64 (build 7601)
            Service Pack 1<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">#<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">#locale:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">#[1] LC_COLLATE=English_United Kingdom.1252
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">#[2] LC_CTYPE=English_United Kingdom.1252  
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">#[3] LC_MONETARY=English_United Kingdom.1252<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">#[4] LC_NUMERIC=C                          
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">#[5] LC_TIME=English_United Kingdom.1252   
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">#<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">#attached base packages:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">#[1] stats     graphics  grDevices utils    
            datasets  methods   base    
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">#<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">#other attached packages:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">#[1] FLAssess_2.5.20130716 FLash_2.5.2          
            FLCore_2.5.20160107 
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">#[4] Matrix_1.2-3          MASS_7.3-45          
            lattice_0.20-33     
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">#<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">#loaded via a namespace (and not attached):<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-family:"Courier
            New"">#[1] grid_3.2.3   stats4_3.2.3<o:p></o:p></span></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
      </div>
      <br>
      <br>
      <span style="font-family:Arial; Font-size:8.0pt">
        <br>
        <br>
        <div style="border-top: 1px solid #000000; width: 90%; font: 9pt
          'Trebuchet MS', Arial, Helvetica, sans-serif;">This email and
          any attachments are intended for the named recipient only. Its
          unauthorised use, distribution, disclosure, storage or copying
          is not permitted. If you have received it in error, please
          destroy all copies and notify the sender. In messages of a
          non-business nature, the views and opinions expressed are the
          author's own and do not necessarily reflect those of Cefas.
          Communications on Cefas’ computer systems may be monitored
          and/or recorded to secure the effective operation of the
          system and for other lawful purposes.</div>
        <br>
        <br>
      </span> <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>