Data from: Accurately estimating correlations between demographic parameters: A comment on Deane et al. (2023)
Data files
Sep 10, 2024 version files 20.51 KB
-
figures.R
8.39 KB
-
mGamma.stan
1.74 KB
-
mUniform.stan
1.74 KB
-
README.md
3.02 KB
-
simulation_marr_Stan.R
5.63 KB
Abstract
Estimating correlations among demographic parameters is an important method in population ecology. A recent paper by Deane et al. (2023) attempted to explore the effects of different priors for covariance matrices on inference when using mark-recovery data. Unfortunately, Deane et al. (2023) made a mistake when parameterizing some of their models. Rather than exploring the effects of different priors, they examined the effects of the use of incorrect equations on inference. In this manuscript, we clearly describe the mistake in Deane et al. (2023). We then demonstrate the use of an alternative and appropriate method and reach different conclusions regarding the effects of priors on inference. Consistent with other recent literature, informative inverse Wishart priors can lead to flawed inference, while vague priors on covariance matrix components have little impact when sample sizes are adequate.
README: Data from: Accurately estimating correlations between demographic parameters: A comment on Deane et al. (2023)
https://doi.org/10.5061/dryad.3bk3j9kv6
Description of the data and file structure
The manuscript uses simulated data.
Files and variables
There are two Stan model files (mGamma.STAN and mUniform.STAN) that analyze the data generated in the simulation_marr_Stan.R file. The figures.R file generates the figures published in the manuscript.
Abbreviations used in simulation_marr_Stan.R:
nS: the number of Simulations to run
nR: the number of individuals to Release during each year
nT: the number of years (i.e., Time-steps) of data to simulate
Gres.rho: storing correlation estimates from each simulation from models using gamma priors
Gres.s1 and Gres.s2: storing standard deviations estimates from each simulation from models using gamma priors
Gres.m1 and Gres.m2: storing mean estimates from each simulation from models using gamma priors for
Ures.rho: storing correlation estimates from each simulation from models using uniform priors
Ures.s1 and Ures.s2: storing standard deviations estimates from each simulation from models using uniform priors
Ures.m1 and Ures.m2: storing mean estimates from each simulation from models using uniform priors
tru.____: the simulated values used to generate the data
rho: the correlation between survival and band-recovery rates
sigma: standard deviations of hunting and natural mortality hazard rate
Sigma: covariance matrix
epsilon: time-varying correlated random effects
h: hunting mortality hazard rates (h[,1] is hunting, h[,2] is natural)
S: Survival
c: crippling loss rate
r: band reporting rate
f: band recovery probability
pr: cell probabilities for the m-array
marr: the simulated m-array
stan_data: data fed to Stan for use in models using uniform and gamma priors
ni: number of iterations
nb: number of iterations to 'burn'
nc: number of chains and cores to use for parallel processing
nt: thinning rate (e.g., we saved every fifth iteration, this is unnecessary)
m1: results from the model with gamma priors for the standard deviations
m2: results from the model with uniform priors for the standard deviations
Abbreviations used in figures.R:
fail: identifying models that did not converge based on Vehtari's modified R-hat
U: a data frame used to plot correlation estimates from the model with uniform priors for the standard deviations
G: a data frame used to plot correlation estimates form the model with gamma priors for the standard deviations
pU: a ggplot scatterplot regressing estimates from the Uniform model against the true values used to generate the data
pG: a ggplot scatterplot regressing estimates from the Gamma model against the true values used to generate the data
pRho: a scatterplot of the median estimates from each model.## Code/software
We used R version 4.2.2 ('innocent and trusting') and the most recent version of Stan and package Rstan, as well as ggplot2.
Methods
The data used in this manuscript were simulated, and the simulation and analysis code are stored in this repository.