Simulation methods for a4a stock assessment fits.

simulate(object, nsim = 1, seed = NULL, ...)

# S4 method for class 'a4aFitSA'
simulate(object, nsim = 1, seed = NULL, empirical = TRUE, obserror = FALSE)

# S4 method for class 'SCAPars'
simulate(object, nsim = 1, seed = NULL, empirical = TRUE)

# S4 method for class 'a4aStkParams'
simulate(object, nsim = 1, seed = NULL, empirical = TRUE)

# S4 method for class 'submodels'
simulate(object, nsim = 1, seed = NULL, empirical = TRUE)

# S4 method for class 'submodel'
simulate(object, nsim = 1, seed = NULL, empirical = TRUE)

Arguments

object

object of relevant class (see signature of method)

nsim

number of iterations

seed

numeric with random number seed

...

additional argument list that might never be used

empirical

logical, shall the empirical method in MASS be used

Examples

data(ple4)
data(ple4.index)
fmodel <- ~factor(age) + factor(year)
qmodel <- list(~factor(age))
fit1 <-  sca(fmodel=fmodel, qmodel=qmodel, stock=ple4, indices=FLIndices(ple4.index))
fit1
#> a4a model fit for: PLE 
#> 
#> Call:
#> .local(stock = stock, indices = indices, fmodel = ..1, qmodel = ..2)
#> 
#> Time used:
#>  Pre-processing     Running a4a Post-processing           Total 
#>      0.14269233      1.37771249      0.03404522      1.55445004 
#> 
#> Submodels:
#> 	 fmodel: ~factor(age) + factor(year)
#> 	srmodel: ~factor(year)
#> 	n1model: ~s(age, k = 3)
#> 	 qmodel:
#> 	   BTS-Combined (all): ~factor(age)
#> 	 vmodel:
#> 	   catch:              ~s(age, k = 3)
#> 	   BTS-Combined (all): ~1
summary(fit1)
#> An object of class "a4aFitSA"
#> 
#> Name: PLE 
#> Description: Plaice in IV. ICES WGNSSK 2018. FLAAP 
#> Quant: age 
#> Dims:  age 	year	unit	season	area	iter
#> 	10	61	1	1	1	1	
#> 
#> Range:  min	max	pgroup	minyear	maxyear	minfbar	maxfbar 
#> 	1	10	10	1957	2017	2	6	
#> 
stock.n(fit1)
#> An object of class "FLQuant"
#> , , unit = unique, season = all, area = unique
#> 
#>     year
#> age  1957    1958    1959    1960    1961    1962    1963    1964    1965   
#>   1   473838  701921  859864  780080  841326  596230  620993 2640249  728827
#>   2   345321  389772  567538  685314  618716  668174  472961  487965 2057493
#>   3   248716  259058  282673  400116  478558  433175  466717  324268  329133
#>   4   178377  173026  171865  180239  251730  302178  272633  286172  194325
#>   5   126843  123615  114268  109023  112792  158114  189175  166215  170460
#>   6    89158   87978   81719   72569   68307   70929   99103  115480   99141
#>   7    61879   62217   58580   52320   45851   43314   44832   61044   69539
#>   8    42452   44471   42892   39004   34430   30270   28513   28845   38495
#>   9    28876   31532   31875   29841   26865   23779   20855   19263   19155
#>   10   19558   34689   44401   48590   48857   47045   43648   38560   33844
#>     year
#> age  1966    1967    1968    1969    1970    1971    1972    1973    1974   
#>   1   610747  421925  386389  596409  603691  399390  348898 1345589 1017694
#>   2   569304  482263  335495  306974  471849  476060  313061  269547 1019845
#>   3  1394248  394093  338444  235048  213303  325779  324818  207597  172138
#>   4   198530  866504  249673  213912  146856  132080  198405  190062  115226
#>   5   116519  122704  546097  156975  132926   90429   79973  115352  104739
#>   6   102345   72104   77422  343747   97663   81953   54825   46562   63670
#>   7    60086   63887   45873   49141  215706   60744   50143   32244   25993
#>   8    44103   39118   42299   30309   32142  139983   38851   30966   19012
#>   9    25688   30099   27085   29235   20767   21875   94091   25341   19413
#>   10   31479   35795   42102   43415   45190   39748   36896   83504   56853
#>     year
#> age  1975    1976    1977    1978    1979    1980    1981    1982    1983   
#>   1   698845  548566  778479  640981  704057  924266  931736 1847652 1298487
#>   2   763211  527449  417317  589503  478538  518558  676092  680952 1357953
#>   3   637885  483395  339318  266048  365468  288876  308838  401960  409349
#>   4    92797  349978  271077  187879  141651  187450  145387  155054  204960
#>   5    61646   50541  194885  149016   99256   72051   93532   72364   78399
#>   6    56130   33629   28188  107304   78861   50580   36020   46644   36658
#>   7    34532   30977   18965   15698   57489   40719   25632   18210   23944
#>   8    14939   20156   18430   11158    8924   31631   22035   13841    9968
#>   9    11661    9285   12734   11533    6780    5273   18425   12812    8142
#>   10   38891   26050   18859   17450   15380   10934    7904   14797   14410
#>     year
#> age  1984    1985    1986    1987    1988    1989    1990    1991    1992   
#>   1  1206091 1644326 3960903 1860346 1839953 1352882 1185562 1052308  916723
#>   2   959194  889540 1201510 2858362 1326880 1304527  964011  852854  758827
#>   3   824510  580594  528659  696764 1619851  743177  737889  555573  493855
#>   4   211670  424498  291336  256305  327070  747967  347935  354641  268802
#>   5   105115  108079  211172  139957  119159  149540  346806  165676  170015
#>   6    40281   53771   53869  101654   65207   54600   69486  165479   79588
#>   7    19080   20877   27169   26309   48086   30348   25761   33645   80654
#>   8    13269   10533   11268   14229   13394   24131   15415   13389   17589
#>   9     5925    7862    6122    6382    7866    7313   13313    8673    7571
#>   10   11466    8735    8566    7173    6574    7125    7094   10883    9640
#>     year
#> age  1993    1994    1995    1996    1997    1998    1999    2000    2001   
#>   1   617155  637103  996786  978696 3186326 1127019  918089  964100  610284
#>   2   655004  436955  451386  705623  680833 2157480  754317  626357  675855
#>   3   431531  365862  244394  252047  380719  348328 1078941  391700  343095
#>   4   232956  198496  168606  112366  110439  154835  137206  448038  175308
#>   5   125589  106096   90574   76754   48714   44390   60249   56328  198460
#>   6    79603   57324   48518   41323   33354   19631   17320   24797   25008
#>   7    37830   36908   26628   22486   18261   13693    7809    7258   11190
#>   8    41238   18920   18489   13312   10777    8199    5978    3571    3544
#>   9     9759   22451   10315   10063    6988    5349    3973    3014    1904
#>   10    8272    8854   16572   12294   10082    7033    5015    3842    3137
#>     year
#> age  2002    2003    2004    2005    2006    2007    2008    2009    2010   
#>   1  1693796  509232  992838  608791  624076 1071216  918743  875219 1202850
#>   2   429740 1176824  351801  698940  440434  461421  804427  700680  678463
#>   3   373477  231296  626359  194310  407329  267893  289367  520051  467748
#>   4   155459  163084   99428  283612   94860  211148  144951  163393  307162
#>   5    78631   67161   69343   44565  137207   48773  113388   81283   95904
#>   6    89216   34051   28626   31151   21603   70674   26235   63682   47776
#>   7    11424   39292   14766   13068   15318   11272   38472   14896   37802
#>   8     5523    5459   18519    7284    6885    8507    6500   23028    9275
#>   9     1908    2892    2825    9964    4147    4101    5232    4128   15126
#>   10    2266    1883    2279    2486    7103    5751    5345    6130    6035
#>     year
#> age  2011    2012    2013    2014    2015    2016    2017   
#>   1  1502024 1354188 1658682 1961517 1171849 1687998 2283111
#>   2   943988 1187249 1075766 1329902 1594711  969047 1421171
#>   3   464014  654770  831645  767388  974951 1208821  760968
#>   4   285811  289187  413743  539093  516870  688194  896622
#>   5   186610  177153  181774  266888  361532  363518  508966
#>   6    58339  115807  111484  117382  179156  254475  269022
#>   7    29328   36518   73486   72550   79337  126831  189193
#>   8    24248   19141   24123   49642   50683   57749   96416
#>   9     6250   16583   13227   16992   35988   38059   45009
#>   10   13947   12237   18891   20766   25552   44558   61496
#> 
#> units:  1000