Learn R Programming

BGGM (version 1.0.0)

bayes_R2: Bayesian Variance Explained (R2)

Description

Compute Bayesian R2. In contrast to the functions mse, mae, etc., this can be used to compare predictabiltiy between nodes within a network or between networks. Also, only posterior predictive R2 is implemented.

Usage

bayes_R2(object, cred = 0.95, iter = 1000, cores = 2, ...)

Arguments

object

object of class estimate

cred

credible interval width used for selecting the network

iter

iterations used for computing R2

cores

number of cores for parallel computing

...

currently ignored

Value

object of classes bayes_R2 and metric

Examples

Run this code
# NOT RUN {
# data
Y <- subset(tas, gender == "M")[,-ncol(tas)]

# fit model
fit <- estimate(Y)

# bayes R2
r2 <- bayes_R2(fit, iter = 50)

# print summary
r2

# plot
plot(r2)
# }

Run the code above in your browser using DataLab