comp_bayes_lm {forestecology} | R Documentation |
Fit Bayesian competition model
Description
Fit a Bayesian linear regression model with interactions terms where
y = X \beta + \epsilon
\mu | mean hyperparameter vector for \beta of length p + 1 |
V | covariance hyperparameter matrix for \beta of dimension (p + 1) x (p + 1) |
a | shape hyperparameter for \sigma^2 > 0 |
b | scale hyperparameter for \sigma^2 > 0 |
Usage
comp_bayes_lm(focal_vs_comp, prior_param = NULL, run_shuffle = FALSE)
Arguments
focal_vs_comp |
data frame from |
prior_param |
A list of |
run_shuffle |
boolean as to whether to run permutation test shuffle of competitor tree species within a particular focal_ID |
Value
A list of {a_star, b_star, mu_star, V_star}
posterior hyperparameters
Source
Closed-form solutions of Bayesian linear regression doi: 10.1371/journal.pone.0229930.s004
See Also
Other modeling functions:
create_bayes_lm_data()
,
predict.comp_bayes_lm()
,
run_cv()
Examples
library(dplyr)
# Load in focal versus comp
data(focal_vs_comp_ex)
comp_bayes_lm_ex <- focal_vs_comp_ex %>%
comp_bayes_lm(prior_param = NULL, run_shuffle = FALSE)
[Package forestecology version 0.2.0 Index]