drmr 0.5.0
New vignette on “algorithms” detailing the methods that can be used to draw samples from the posterior.
summarymethod for the output of theages_edensoutput.drawsmethod added to the package.margmethod to .Fixed a bug in the
sdm.stanAR(1) term.Fixed duplicated random effects in
drm.stanImproved performance for
drm.stanandsdm.stanSuper class for DRMs and SDMs, so
print,summary, anddrawsmethods are simplified.A class
pred_drmrwas created for the output of thepredictandfittedmethods. It facilitates joining those outputs to the observed data.We had some functions called patches sites and vice-versa. Now everything is standardized using “site” for patches/sites (I know, it does sound confusing).
elpdfunctions temporarily unavailable
drmr 0.4.0
predictandfittedmethods now have an argument calledtype, which allows to compute predictions based on the posterior predictive distribution (default and corresponds to old behavior), expected value of the posterior predictive distribution (i.e., its theoretical mean), and latent density (disconsidering observation error).Removing loglogistic distribution for now (need to do some work on the parametrization)
Major bug in the fitted/predict functions fixed.
Some improvements to documentation.
Fixed bug in how we deal with zeros and NAs.
A function called
summary_age_densitiesto process the output ofages_edensis now available.Fixed (again) the
lambda_drmfunction (to extract age specific densities) and changed its name toages_edens(stands for “age-specific expected age densities”.log_likandfittedmethods are now defined foradrmandsdmobjects.Calculations for log-likelihood improved for easier maintenance.
predict_drmandpredict_sdmare now methods.Another increase in performance for the
predict(andelpd) function. Especially relevant for larger datasets.printandsummarymethods are now available foradrmandsdmobjects.Different inference algorithms are now alowed through the
algorithmargument. A newalgo_argsargument is also introduced for specific inputs regarding thealgorithms. For example,iter_warmup(specifying the number of warmup iterations),iter_sampling(number of sampling iterations),chains(number of MCMC chains),parallel_chains(number of chains to run in parallel),adapt_deltaamong others are supposed to be input as elements of a list passed asalgo_argsparameter.
drmr 0.3.0
New classes (and validators) created for the output of the
fit_drmandfit_sdmfunctions. The classes are calledadrmandsdm, respectively.An
updatemethod to facilitate model refitting is introduced.
drmr 0.2.3
Bug fixed when computing the log-lik from a truncated normal model.
The
elpdmethod has been included with the package and works with the outputs offit_drmandfit_sdm. This method is helpful in calculating out-of-sample ELPD to perform leave-future-out cross validation (e.g., see https://mc-stan.org/loo/articles/loo2-lfo.html )The
predict_*functions have been modified so they only return the predicted values at the new sites/times. Before this update, those functions also returned other quantities such asmu_proj(the expected value of the “non-zero” part of the density),rho_proj(probability of non-zero density), andzt(the AR random effect, if its switch is turned on).Improved the code to facilitate manteinance of the likelihood functions
Fixing
lambda_gq.Creating
fittedandlog_likelihoodfunctions.
drmr 0.2.2
Ensuring there are no
NAs in the covariates,site, ortime.Added support for missingness on
y.Functions for vectorzing the zero-inflated densities were moved to
R(as opposed toStan). Therefore, the indexes of the “zeros” in the response variables become an input fromRtoStan.Spatial and iid random effects also included in the SDM functions.
Typos in the “Parameters, priors, and toggles” vignette were fixed.
instantiateversion must be at least0.2.3.9002, so we can use#includefor functions.
drmr 0.2.1
A new toggle called
rho_muintroduced. Its default value is1and stands for explicitly relating the probability of observing a 0 (rho) to the latent density (mu). See Yee 2014 and references therein.A new vignette with a comprehensive list of the model parameters and their priors is available.
A new vignette detailing the initialization procedures is also included.
drmr 0.2.0
initnow admits real numbers too.init_data: default now is to initialize the age-classes for all patches ranging from.9to.01.-
Allowing for choosing which process is correlated in time;
- The variable
rawbecamew_t; -
taubecamesigma_t - The flag
time_arbecamear_re(stands for AR random effect). Now,ar_recan assume three values:- “none”, the default indicating no AR random effects.
- “rec” (AR for recruitment)
- “surv” (AR for survival)
- “dens” (AR for density)
- The variable
-
Unstructured random effects.
- The following variables are added to the model:
z_ipatch specific random effect andsigma_ithe SD of the iid random effect. - Similarly to
ar_re, the unstructured random effects can be enabled through the flatiid_re, which also admits the following entries:- “none” (default) indicating no IID random effects.
- “rec” (IID for recruitment)
- “surv” (IID for survival)
- “dens” (iID for density)
- The following variables are added to the model:
-
ICAR random effects
- The following variables are added to the model:
w_s,z_spatch specific random effect andsigma_sthe approx marginal SD of the spatial random effect. - Similarly to the two structures mentioned above, the flag
sp_readmits the following values: “none” (default), “rec” (recruitment), “surv” (survival), and “dens” (density).
- The following variables are added to the model:
Functions for data simulation were temporarily removed.
Fixing
init_dataFixing bugs regarding the popdyn initialization.
drmr 0.1.3
Modified
examples.qmdto prevent errors due to pathfinder failing.Updated github actions.
Same problematic behaviour that was affecting
make_datahad to be dealed with prior initialization and predictions.-
Options for “data informed” phi priors through the floag
phi_hatWhen
family = "gamma"and a prior forphiis not provided, the default prior for this parameter is a Gamma withshape = 2andrate = ybar * s2. This prior has its theoretical mean at the method of moments estimator ofphi.When
family = "lognormal"and a prior forphiis not provided, the default prior for this parameter is a Gamma having its theoretical mean at the MLE ofphi.
fixed typo when defining log-logistic reparametrization
drmr 0.1.2
lambda_drmfunction added to recover the age-specific densities form afit_drmcall.fixed a bug on the
forecast.stanscript.
drmr 0.1.1
Vignettes updated so
R CMD check“works”.The
lambdas are no longer returned by the fit and predict functions. Returning those values imply a significant decrease in the computational performance, especially as increasing the sample size.The AR term in the model was “corrected”.
Some bugs with prior initialization for the sdm were fixed.
drmr 0.1.0
Exporting
fix_linbeta,max_quad_x, andint_scorefunctionsFixing
check_betweenfunction (not exported; This functions is just a helper)Changed prior on
zetaand allowing for user to input the hyperparameters. Before, we had a standard normal prior on the logit ofzeta. Now, we place a beta prior onzeta.Included support for different types of population dynamics initialization
Fixed how pdf and random number generation from location-scale Student’s t distribution
rlangbecame a dependency.Included functions for simulating data from the DRM model and prior predictive checks.
Trying to avoid overflow by making calculations on the log-scale whenever it’s possible.
Constraining
alphato .Prior on
phinow is Gamma.fit_drmandfit_sdmreturns changed. Now, the elementdrawsis calledstanfit. In addition, there is an additional element to the returned list calledformulas. Theformulaselements aims at making thepredict_*functions less error prone.The QR parametrization toggles were completely removed.
The
coef_*parameters were converted tobeta_*. That is,coef_rnow isbeta_r; whilecoef_tnow isbeta_t, and so on.The
pr_logsd_r_*inputs converted topr_ltau_*.Functions to plot effect of covariates on recruitment, survival, or absence probability were included.
est_mortbecomesest_surv(as it makes more sense with the text).get-startedandexamplesvignette updated.
drmr 0.0.24
Initial values for population dynamics have been fixed.
Vignettes to quarto
New
betweenfunction based ondata.table::between.int_scorefunction to calculate the interval score was also included. The interval score helps to assess interval predictions.age_at_maturityis replaced byages_movement. The former can take either a single integer indicating the age at which individuals start to move, or a vector with 0s for age-groups that do not move and 1s for age-groups that are allowed to move.
drmr 0.0.23
The prior for has been modified. In particular, instead of a pcp prior, now we put a Beta prior on . The hyperparameters of this Beta distribution are
pr_alpha_aandpr_alpha_b, respectively.-
New functions to initialize the parameters from the prior have been introduced. Now the
initparmeter from thefit_sdmandfit_drmfunctions can take three possible values:- “default”: the standard initialization in
Stan(For details seeStan's documentation). - “prior”: initialize the parameters using samples from their respective prior distributions;
- “pathfinder”: uses the Pathfinder algorithm to initialize the parameters.
- “default”: the standard initialization in
Fixed some issues with documentation.
drmr 0.0.22
fit_drmandfit_sdmfunctions to make model fitting slightly simpler.pr_phi_aandpr_phi_bbecomepr_phi_muandpr_phi_sd. The prior for is a Student’s t with 3 degrees of freedom, meanpr_phi_muand SDpr_phi_sd.Selectivity in
make_datawas fixed, thanks to Mark. Before, it was not being used when users input it.
drmr 0.0.21
make_data_sdmfunction (analogous tomake_data) created for SDM.predict_sdmfunction (analogous topredict_drm) created for SDM.
drmr 0.0.2
Parameters in the code and documentation were properly matched.
p_errortoggle becomestime_artoggle (more appropriate).predict_drmfunction createdthe
make_datafunction now has afamilyargument indicating the probability distribution assumed for the response (given all the model parameters and latent variables)
