Closed ejardim closed 10 years ago
fmodel <- ~ s(age, k=4) + s(year, k = 20) qmodel <- list( ~ s(age, k=4) + year) srmodel <- ~s(year, k=20) fit <- a4aSCA(ple4, ple4.indices[1], fmodel, qmodel, srmodel) fits <- simulate(fit, 25) stks <- ple4 + fits idxs <- ple4.indices[1] index(idxs[[1]]) <- index(fits)[[1]]
fits <- a4aSCA(stks, idxs, fmodel, qmodel, srmodel, fit="MP")
fits <- a4aSCA(stks, ple4.indices[1], fmodel, qmodel, srmodel, fit="MP")
Problem was using "[" for subseting iters. When one of the slots onthe object doesn't have iters this method fails. Using "iter" sorts out the problem.
fmodel <- ~ s(age, k=4) + s(year, k = 20) qmodel <- list( ~ s(age, k=4) + year) srmodel <- ~s(year, k=20) fit <- a4aSCA(ple4, ple4.indices[1], fmodel, qmodel, srmodel) fits <- simulate(fit, 25) stks <- ple4 + fits idxs <- ple4.indices[1] index(idxs[[1]]) <- index(fits)[[1]]
this one doesn't work
fits <- a4aSCA(stks, idxs, fmodel, qmodel, srmodel, fit="MP")
this one does
fits <- a4aSCA(stks, ple4.indices[1], fmodel, qmodel, srmodel, fit="MP")