<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<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;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"Trebuchet MS";
        panose-1:2 11 6 3 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;
        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;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New",serif;
        color:black;}
tt
        {mso-style-priority:99;
        font-family:"Courier New",serif;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;
        mso-fareast-language:EN-US;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@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]-->
</head>
<body bgcolor="white" lang="EN-GB" link="#0563C1" vlink="#954F72">      
    
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Hi Laurie,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Thank you very much for your solution, works perfectly!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Simon<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="color:windowtext;mso-fareast-language:EN-GB">From:</span></b><span lang="EN-US" style="color:windowtext;mso-fareast-language:EN-GB"> flr-list-bounces@lists.r-forge.r-project.org [mailto:flr-list-bounces@lists.r-forge.r-project.org]
<b>On Behalf Of </b>laurie<br>
<b>Sent:</b> 26 February 2016 15:32<br>
<b>To:</b> flr-list@lists.r-forge.r-project.org<br>
<b>Subject:</b> Re: [FLR-list] fwd(), catch differs from targeted catch<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;font-family:"Courier New",serif"><br>
</span>There is a problem with indexing ages, if the ages go from 1, then it is OK<br>
<br>
<tt><span style="font-size:10.0pt">load("/home/laurie/Desktop/temp/data.RData")</span></tt><span style="font-size:10.0pt;font-family:"Courier New",serif"><br>
<tt>ctrl <- fwdControl(data.frame(year = 0, quantity = "catch", val = 111111111))</tt><br>
<tt>stock=stock[-1]</tt><br>
<tt>res <- fwd(stock, ctrl = ctrl, sr = srr)</tt><br>
<tt>catch(res)[,"0"]</tt><br>
<br>
</span>i.e. any 1st age other than 1 causes a problem. <br>
<br>
Laurie<br>
<br>
<span style="font-size:12.0pt;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<div>
<p class="MsoNormal">On 26/02/16 13:25, Simon Fischer (Cefas) wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<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",serif">### load FLR</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">library(FLash)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">library(FLAssess)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">### load data </span>
<o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">load("data.RData")</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">### contains FLStock "stock" and FLSR "srr"</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">### extend stock for 1 year</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">stock <- stf(object = stock, nyears = 1) 
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">### create fwdControl object</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">ctrl <- fwdControl(data.frame(year = 1, quantity = "catch", val = 111697431))</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">### fwd prediction</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">res <- fwd(stock, ctrl = ctrl, sr = srr)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">### check predicted catch</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">catch(res)[,ac(1)]</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">### 115308236 and NOT 111697431 as specified in the control object?</span><o:p></o:p></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",serif">#> sessionInfo()</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">#R version 3.2.3 (2015-12-10)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">#Platform: i386-w64-mingw32/i386 (32-bit)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">#Running under: Windows 7 x64 (build 7601) Service Pack 1</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">#</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">#locale:</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">#[1] LC_COLLATE=English_United Kingdom.1252
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">#[2] LC_CTYPE=English_United Kingdom.1252  
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">#[3] LC_MONETARY=English_United Kingdom.1252</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">#[4] LC_NUMERIC=C                          
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">#[5] LC_TIME=English_United Kingdom.1252   
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">#</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">#attached base packages:</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">#[1] stats     graphics  grDevices utils     datasets  methods   base    
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">#</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">#other attached packages:</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">#[1] FLAssess_2.5.20130716 FLash_2.5.2           FLCore_2.5.20160107 
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">#[4] Matrix_1.2-3          MASS_7.3-45           lattice_0.20-33     
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">#</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">#loaded via a namespace (and not attached):</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">#[1] grid_3.2.3   stats4_3.2.3</span><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:EN-GB"><br>
<br>
<br>
</span><span style="font-size:8.0pt;font-family:"Arial",sans-serif;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<div style="border:none;border-top:solid black 1.0pt;padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Trebuchet MS",sans-serif;mso-fareast-language:EN-GB">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.<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Arial",sans-serif;mso-fareast-language:EN-GB"><br>
<br>
</span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:EN-GB"><br>
<br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>flr-list mailing list<o:p></o:p></pre>
<pre><a href="mailto:flr-list@flr-project.org">flr-list@flr-project.org</a><o:p></o:p></pre>
<pre><a 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><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:EN-GB"><o:p> </o:p></span></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>
 

</body>
</html>