[FLR-list] fwd(), catch differs from targeted catch
laurie
lauriekell at gmail.com
Fri Feb 26 19:26:32 CET 2016
Thanks, but it is a bug that needs to be fixed. If the 1st age is 2 then
you again get a different result!
Laurie
On 26/02/16 17:24, Simon Fischer (Cefas) wrote:
>
> Hi Laurie,
>
> Thank you very much for your solution, works perfectly!
>
> Regards,
>
> Simon
>
> *From:*flr-list-bounces at lists.r-forge.r-project.org
> [mailto:flr-list-bounces at lists.r-forge.r-project.org] *On Behalf Of
> *laurie
> *Sent:* 26 February 2016 15:32
> *To:* flr-list at lists.r-forge.r-project.org
> *Subject:* Re: [FLR-list] fwd(), catch differs from targeted catch
>
>
> There is a problem with indexing ages, if the ages go from 1, then it
> is OK
>
> load("/home/laurie/Desktop/temp/data.RData")
> ctrl <- fwdControl(data.frame(year = 0, quantity = "catch", val =
> 111111111))
> stock=stock[-1]
> res <- fwd(stock, ctrl = ctrl, sr = srr)
> catch(res)[,"0"]
>
> i.e. any 1st age other than 1 causes a problem.
>
> Laurie
>
> On 26/02/16 13:25, Simon Fischer (Cefas) wrote:
>
> Dear all,
>
> 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.
>
> 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).
>
> Did anyone else encounter this behaviour or knows how to avoid it?
>
> 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().
>
> Thanks in advance,
>
> Simon
>
> Minimal reproducible example:
>
> ### load FLR
>
> library(FLash)
>
> library(FLAssess)
>
> ### load data
>
> load("data.RData")
>
> ### contains FLStock "stock" and FLSR "srr"
>
> ### extend stock for 1 year
>
> stock <- stf(object = stock, nyears = 1)
>
> ### create fwdControl object
>
> ctrl <- fwdControl(data.frame(year = 1, quantity = "catch", val =
> 111697431))
>
> ### fwd prediction
>
> res <- fwd(stock, ctrl = ctrl, sr = srr)
>
> ### check predicted catch
>
> catch(res)[,ac(1)]
>
> ### 115308236 and NOT 111697431 as specified in the control object?
>
> #> sessionInfo()
>
> #R version 3.2.3 (2015-12-10)
>
> #Platform: i386-w64-mingw32/i386 (32-bit)
>
> #Running under: Windows 7 x64 (build 7601) Service Pack 1
>
> #
>
> #locale:
>
> #[1] LC_COLLATE=English_United Kingdom.1252
>
> #[2] LC_CTYPE=English_United Kingdom.1252
>
> #[3] LC_MONETARY=English_United Kingdom.1252
>
> #[4] LC_NUMERIC=C
>
> #[5] LC_TIME=English_United Kingdom.1252
>
> #
>
> #attached base packages:
>
> #[1] stats graphics grDevices utils datasets methods base
>
> #
>
> #other attached packages:
>
> #[1] FLAssess_2.5.20130716 FLash_2.5.2 FLCore_2.5.20160107
>
> #[4] Matrix_1.2-3 MASS_7.3-45 lattice_0.20-33
>
> #
>
> #loaded via a namespace (and not attached):
>
> #[1] grid_3.2.3 stats4_3.2.3
>
>
>
>
> 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.
>
>
>
>
>
>
> _______________________________________________
>
> flr-list mailing list
>
> flr-list at flr-project.org <mailto:flr-list at flr-project.org>
>
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/flr-list
>
>
>
>
>
> 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.
>
>
>
>
> _______________________________________________
> flr-list mailing list
> flr-list at flr-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/flr-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/flr-list/attachments/20160226/209ce184/attachment-0001.html>
More information about the flr-list
mailing list