We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pumping a table of abundance from a model into another is hard(tm):
st <- g3_stock("x", 1:19) oth_table <- expand.grid( year = 1991:2020, step = 1:4, length = 1:19 ) oth_table$value <- floor(runif(nrow(oth_table), 1e3, 1e4)) lookup_array <- function(tbl_name, tbl) { tbl_arr <- g3_array_agg(gadget3:::g3_distribution_preview(oth_table)) out <- gadget3:::call_to_formula(substitute( arr[,step = g3_idx(cur_step), year = g3_idx(cur_year - start_year + 1)], list(arr = as.symbol(tbl_name)) ), list()) environment(out)[[tbl_name]] <- tbl_arr return(out) } actions <- list( g3a_time(2000, 2005, c(3,3,3,3)), g3a_otherfood(st, lookup_array("oth_abund", oth_table), force_lengthvector = FALSE ), NULL) full_actions <- c(actions, list( g3a_report_detail(actions) )) model_fn <- g3_to_r(full_actions) model_cpp <- g3_to_tmb(full_actions) attr(model_cpp, 'parameter_template') |> identity() -> params.in nll <- model_fn(params.in) ; r <- attributes(nll) ; nll <- as.vector(nll) print(r$detail_x__num) gadget3:::ut_tmb_r_compare2(model_fn, model_cpp, params.in)
What would be nice is a g3a_otherfood_table(), which munges the input table into an array as we do with likelihood data, and then fills the output.
g3a_otherfood_table()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Pumping a table of abundance from a model into another is hard(tm):
What would be nice is a
g3a_otherfood_table()
, which munges the input table into an array as we do with likelihood data, and then fills the output.The text was updated successfully, but these errors were encountered: