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

"+" with bio index and assessment type fails #21

Closed ejardim closed 10 years ago

ejardim commented 10 years ago

data(ple4) bioidx <- FLIndex(FLQuant(NA, dimnames=list(age="all", year=range(ple4)["minyear"]:range(ple4)["maxyear"]))) index(bioidx) <- stock(ple4)_0.001 index(bioidx) <- index(bioidx)_exp(rnorm(index(bioidx), sd=0.1))

fit <- sca(ple4, FLIndices(bio=bioidx), qmodel=list(~1)) ple4+fit # this works

fit <- sca(ple4, FLIndices(bio=bioidx), qmodel=list(~1), fit="assessment") ple4+fit # this one doesn't

ejardim commented 10 years ago

The problem is in the simulate method that it's called. Removed the "+" method for a4aFitSA, it inherits from a4aFit and so no simulation is drawn. Added the methods "*" which DO run the simulations.