sim_and_fit | R Documentation |
Simulate a population and fit it using pbsEDM::pbsEDM(), for getting full results for any specific simulation. Allows estimation based on 'R_t' or 'R_prime_t'. Removes knowledge of the final value since knowing that affects the rho calculations.
sim_and_fit(
salmon_sim_args = list(),
pbsEDM_args = list(lags = list(R_switch = 0, S_t = 0:3)),
R_switch = "R_prime_t"
)
salmon_sim_args |
List of arguments to pass onto 'salmon_sim()'. |
pbsEDM_args |
List of arguments to pass onto 'pbsEDM::pbsEDM()'. Note that 'lags' has no default, so needs to be specified here. First one must be called 'R_switch' to then get automatically changed to what is specified by the 'R_switch' parameter |
R_switch |
either 'R_prime_t' or 'R_t' to specify which one the calculations are based on. |
List object with components: - 'simulated:' the simulated tibble - 'fit:' the full output from pbsEDM::pbsEDM().
Andrew Edwards
## Not run:
res <- sim_and_fit(salmon_sim_args = list(deterministic = TRUE))
plot(res$fit$N_observed, res$fit$N_forecast)
abline(a = 0, b = 1) # looks good for deterministic run, which is good
res <- sim_and_fit(pbsEDM_args = list(lags = list(R_prime_t = 0,
S_t = 0:3),
first_difference = TRUE))
res$fit$results$X_rho
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.