run_cv: Run the bayesian model with spatial cross validation
Description
This function carries out the bayesian modeling process with spatial
cross-validation as described in Allen and Kim (2020). Given a
focal-competitor data frame, it appends a column with predicted growth values.
Distance to determine which neighboring trees to a focal tree are competitors.
blocks
An sf object of a blockCV block output
prior_param
A list of {a_0, b_0, mu_0, V_0} prior hyperparameters.
Defaults to a_0 = 250, b_0 = 250, mu_0 a vector of zeros of
length \(p + 1\), V_0 an identity matrix of dimension \((p + 1) x (p
+ 1)\)
run_shuffle
boolean as to whether to run permutation test shuffle of
competitor tree species within a particular focal_ID
Value
focal_vs_comp with new column of predicted growth_hat