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 observations, n_obs. 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 14 |
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) |
alpha |
probability of NOT being observed (i.e. alpha = 1 - detection probability) |
gamma |
probability of being observed exactly twice (gamma = 1 - alpha - beta) |
beta |
(optional) probability of being observed exactly once. If not specified, it's calculated as: beta = 1 - alpha - gamma |
det_prob |
(optional) probability of being observed. If not specified, it's calculated as: det_prob = beta + gamma |
sigma |
(optional) detection parameter (meters). Best to leave this blank and it will be calculated from det_prob. |
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 1/savefilename. If there is an error, the function returns NA and also saves a file to 'working directory'/Scenario 1/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 1/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.