This function takes in the output from a sparta occupancy model and rescales the posteriers so that the gemean for each species is the same in the first year. This function accounts for species that have no data at the beginning of the period, by bringing them in at the geomean, and those that have no data at the end of the period, by applying a multiplier to the result of the species data.
Usage
rescale_posterior(
input_dir,
subset_table = NULL,
index = 100,
max = 10000,
min = 1,
year_limit = 10,
upperQuantile = 0.975,
lowerQuantile = 0.025,
verbose = TRUE
)
Arguments
- input_dir
the location of occupancy model output files
- subset_table
dataframe with columns for years and rows for species. Column names must be character years and row names must match the file names in input_dir
- index
The index value for the first year, defaults to 100.
- max
The upper limit allowed for scaled values. Values greater than this will be set equal to
max
.- min
The upper limit allowed for scaled values. Values greater than this will be set equal to
min
.- year_limit
The minimum length of 'good years' for a species to be included
- upperQuantile
The upper confidence interval to use (as a probability)
- lowerQuantile
The lower confidence interval to use (as a probability)
- verbose
If TRUE progress is written to console