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

sca output makes predict fail when more than one index is used. #32

Closed ejardim closed 10 years ago

ejardim commented 10 years ago

a4aSCA works fine.

library(FLa4a) data(ple4) data(ple4.indices) fit <- sca(ple4, ple4.indices, fit="assessment") flqs <- predict(fit)

sfrac <- mean(range(ple4.indices[[1]])[c("startf", "endf")]) Z <- (m(ple4) + harvest(fit))_sfrac lst <- dimnames(fit@index[[1]]) lst$x <- stock.n(fit)_exp(-Z) stkn <- do.call("trim", lst) qhat <- index(fit)[[1]]/stkn all.equal(c(qhat), c(flqs$qmodel[[1]]))

ejardim commented 10 years ago

Temporary fix. Colin's working on a better fix.