Description Usage Arguments Value Examples
This function is one of the master functions in this package. It simulates and analyzes a single dataset that is over-dispersed in detection probability, det_prob. To do this many times, use an apply function. It's currently simplified and assumes constant abundance, detection, and transect length. It does not (yet) simulate goodness-of-fit metrics. It simulates both point count and distance data and analyses both datasets using both unmarked and optim.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
n_sites |
number of sites (transects) |
n_samps |
number of samples (replicates) per site |
lambda |
mean abundance at every site (single draw per site that stays constant across samples) |
mean_det_prob |
average probability of being observed. Each simulation will draw a random detection probability from a beta distribution with a mean of mean_det_prob |
sigma_beta_dist_p |
sigma on a beta distribution for the realized detection parameter. It's recommended to keep this below ~ 0.15. Above that the beta distribution becomes bimodal with modes near 0 and 1. |
alpha |
(optional) parameter of the beta distribution. It's recommended NOT to specify this parameter. Just specify the mean and sigma, and this value will be calculated to match the given mean and sigma. |
beta |
(optional) parameter of the beta distribution. It's recommended NOT to specify this parameter. Just specify the mean and sigma, and this value will be calculated to match the given mean and sigma. |
W |
transect half-width (meters) |
reps_to_analyze |
the number of samples/replicates to analyze. If NA, it will analyse all replicates in the data. |
return |
What to return from the function call. Currently the only option is 'results'. May change this to only analyze simulated goodness-of-fit metrics. |
savefilename |
The simulated datasets and results ARE saved to file (currently not optional). This provides the path and filename for saving the intermediate steps in the analysis. |
if everything works well, it returns a data.frame with the results of simulating a single dataset, analyzing it in 4 ways, and calculating randomized quantile residuals a la Knape et al. 2018. It also saves a list with the simulated dataset, dataframe of results (minus rqr residual info), and the actual rqr residuals to a savefilename inside the folder path 'working directory'/results/Scenario 3/savefilename. If there is an error, the function returns NA and also saves a file to 'working directory'/Scenario 3/set x/errors with the simulated dataset and the results data.frame but no rq-residuals (it's basically assumed that the rq-residuals were the source of the error.) Similarly, with a warning the function returns the results data.frame and also saves a file to 'working directory'/Scenario 3/set x/warnings with the simulated dataset and the results data.frame but no rq-residuals (it's basically assumed that the rq-residuals were the source of the error.) The user will have to go back and try to calculate rq-residuals from the output later.
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.