Code and workflows used to conduct analyses and create figures for the introduction of state space estimation of CTDS models. The workflow is designed to be run using the targets workflow manager for R, partly on the Duke University Compute Cluster via SLURM cluster management software, and partly on personal computers. The cluster configurations are difficult to make completely reproducible.
- Install the
dsmovetools2d
package inpackages/dsmovetools2d
. The package is primarily used for evaluating the likelihood and for providing additional utility functions; the package is not intended for distribution via CRAN. - Build targets that contain posterior surfaces and comparisons. Targets can be built by using the
targets::tar_make
function within R. Setting thetar_make
optioncallr_function = NULL
within an interactive R environment can let users explore code as it is running ifbrowser()
calls are added to the workflow scripts:- Posterior distribution targets for application
- whale_ll_approx: evaluates likelihood at gridded parameter values
- Save results to file
whale_ll_subsets.rds
as some targets require the output in this format for subsequent processing
- Save results to file
- whale_marginal_approx: evalutes marginal distributions for locations at gridded parameter values
- whale_marginal_location_post, whale_marginal_additional_location_post, whale_marginal_additional_location_post2: build posterior distributions for a whale's location
- whale_ll_approx: evaluates likelihood at gridded parameter values
- Additional plots for application
- zc095_post_loc_comparison, zc095_post_uncertainty_comparison: build plots that compare uncertainty in estimates of a whale's location under different scenarios
- Simulation targets
- simulation_results_combined_univariate, simulation_results_combined_bivariate: builds tables and figures that compare parameter estimates across computational methods
- Running these targets should automatically run all required simulations and estimations.
- simulation_results_combined_univariate, simulation_results_combined_bivariate: builds tables and figures that compare parameter estimates across computational methods
- Posterior distribution targets for application
- Run tmp_crawl.R to generate AID-based estimates of a whale's location for comparison.
- Run distance_from_seafloor.R to make and compare estimates of seafloor depth at specific times, and summarize predictions in a figure.
The function targets::tar_make_future
can be used to build targets instead of using targets::tar_make
if one has access to parallel computing resources. See the targets manual chapter on High performance computing (HPC) for more details about supported features. HPC workflows are difficult to make reproducible because system configurations