flr / FLa4a

The repository for the JRC initiative on stock assessment
https://fishreg.jrc.ec.europa.eu/web/a4a
12 stars 6 forks source link

Question about vcov in a4aGr in the context of multiple iterations #80

Closed jaado closed 7 years ago

jaado commented 8 years ago

Not sure how vcov is used when there are multiple iterations for the parameters, but only one vcov. E.g.

' mm <- matrix(NA, ncol=3, nrow=3)

' diag(mm) <- c(50, 0.001,0.001)

' mm[upper.tri(mm)] <- mm[lower.tri(mm)] <- c(0.1,0.01,0.00004)

' vbObj <- a4aGr(grMod=~linf(1-exp(-k(t-t0))), grInvMod=~t0-1/k*log(1-len/linf), params=FLPar(linf=58.5, k=0.086, t0=0.001, units=c("cm","ano-1","ano")), vcov=mm, distr="norm")

' vbObj <- mvrnorm(100,vbObj)

Will the same vcov be used for each set of parameters in vbObj going forward? Is it possible to have a different vcov for each set of parameters?

ejardim commented 8 years ago

Several vcov can be used. At the moemnt the method will apply the replacement rule if the number of iters and the number of vcov don't match. Seems bad design to me ... IMO this should be constraint to one vcov, to avoid having mixed simulations.