[FLR-list] Error in a4aout at harvest + m(stock) : non-con
Ernesto
ernesto.jardim at jrc.ec.europa.eu
Tue Feb 24 10:01:41 CET 2015
Hi,
Sorry for the late reply.
The problem is that your catch data has a large number of ages that
don't have tunning data. The default model for a4a was not written for
those cases. Check
a4afit <- sca(gul0001, gul.indices)
wireframe(data~year+age, data=harvest(a4afit))
F in the last ages gets loose and the fit is quite poor.
Once that you want to compare with XSA we can take the same kind of
approach, which is to force the oldest ages Fs the same. In this case
the model will fit one coefficient (times the year coefficients) for
ages older than 18, which mean they are fit together, which I think is
slightly different from XSA. Note that you have a large +group in some
years.
This can be done using the "replace" method.
fmod <- ~te(replace(age, age>18, 18), year, k = c(6, 10), bs = "tp")
a4afit <- sca(gul0001, gul.indices, fmodel=fmod)
For comparison
xsafit <- FLXSA(gul0001, gul.indices, FLXSA.control())
wireframe(data~year+age|qname,
data=as.data.frame(FLQuants(a4a=harvest(a4afit), xsa=xsafit at harvest)))
Now, the one million dollars question is why you want to replicate XSA ;)
Best
EJ
ps: Take a look at the residuals and you'll see that both fits have some
odd residuals. In a4a you have a couple of simple options to improve
this fit, like including a year trend in the catchability of the trawl
cpue, etc.
bubbles(age~year|qname, data=xsafit at index.res)
plot(residuals(a4afit, gul0001, gul.indices))
On 02/18/2015 02:35 PM, Havstovan FAMRI wrote:
> Hi,
>
> Well that solved the problem (trimming the indices object
> trim(gul.indices[[2]], age 4:12). No errors come up but stock numbers
> and F's are really spurious
> and nothing in the range of the XSA run. F are given below as a example:
>
> > gulfit at harvest[,ac(2010:2014)] # a4a output
> An object of class "FLQuant"
> , , unit = unique, season = all, area = unique
>
> year
> age 2010 2011 2012 2013 2014
> 4 0.00061883 0.00054841 0.00088312 0.00104010 0.00070947
> 5 0.00194001 0.00170594 0.00221326 0.00254813 0.00223464
> 6 0.00515556 0.00454088 0.00496769 0.00561751 0.00602334
> 7 0.01007180 0.00901793 0.00900872 0.01006750 0.01202780
> 8 0.01384780 0.01273870 0.01257350 0.01389800 0.01666770
> 9 0.01448220 0.01365150 0.01385510 0.01499370 0.01669910
> 10 0.01336920 0.01269240 0.01303890 0.01351880 0.01358130
> 11 0.01248430 0.01165750 0.01145380 0.01107690 0.01019620
> 12 0.01247860 0.01127330 0.00997400 0.00880635 0.00769486
> 13 0.01285800 0.01125750 0.00874288 0.00700203 0.00595635
> 14 0.01248820 0.01082000 0.00757566 0.00557152 0.00460538
> 15 0.01064480 0.00939845 0.00633618 0.00439713 0.00344647
> 16 0.00797521 0.00732193 0.00509501 0.00344610 0.00249670
> 17 0.00569563 0.00541743 0.00403299 0.00273092 0.00182383
> 18 0.00435670 0.00416232 0.00326465 0.00224600 0.00142545
> 19 0.00388555 0.00355594 0.00278197 0.00194974 0.00124088
> 20 0.00406418 0.00340829 0.00250123 0.00177887 0.00119688
> 21 0.00465988 0.00349410 0.00231912 0.00166745 0.00122197
>
> units: f
> > gul_F[,ac(2010:2014)] # XSA output
> 2010 2011 2012 2013 2014
> 4 0.0047 0.0115 0.0015 0.0066 0.0053
> 5 0.0143 0.0311 0.0100 0.0154 0.0296
> 6 0.0675 0.0787 0.0485 0.0655 0.0872
> 7 0.1257 0.1506 0.0947 0.1182 0.1404
> 8 0.1696 0.2211 0.1632 0.1897 0.2082
> 9 0.2107 0.2428 0.1669 0.2651 0.2607
> 10 0.2624 0.3209 0.2170 0.2783 0.2700
> 11 0.2686 0.3086 0.2396 0.3374 0.2840
> 12 0.3309 0.4213 0.2750 0.3371 0.2146
> 13 0.4980 0.6288 0.4110 0.4805 0.2861
> 14 0.4428 0.5557 0.4666 0.5562 0.3298
> 15 0.4462 0.5266 0.4679 0.6606 0.4605
> 16 0.3444 0.4555 0.4277 0.5946 0.4433
> 17 0.2812 0.3540 0.3561 0.5347 0.3910
> 18 0.2529 0.3157 0.3512 0.4841 0.3601
> 19 0.4566 0.2772 0.1803 0.2773 0.3215
> 20 0.2534 0.3124 0.2804 0.4170 0.4099
> 21 0.2534 0.3124 0.2804 0.4170 0.4099
>
> best,
> Luis
>
>
>
> _______________________________________________
> flr-list mailing list
> flr-list at flr-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/flr-list
--
Ernesto Jardim<ernesto.jardim at jrc.ec.europa.eu>
Fisheries Scientist
FISHREG – Scientific Support to Fisheries
IPSC Maritime Affairs Unit
EC Joint Research Center
TP 051, Via Enrico Fermi 2749
I-21027 Ispra (VA), Italy
Office : +39 0332 785311
Fax: +39 0332 789658
https://fishreg.jrc.ec.europa.eu/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/flr-list/attachments/20150224/53097727/attachment.html>
More information about the flr-list
mailing list