extr_outs {ProbBreed} | R Documentation |
Extracting outputs from bayes_met()
objects
Description
This function extracts outputs of the Bayesian model fitted
using bayes_met()
, and provides some diagnostics about the model
Usage
extr_outs(
data,
trait,
model,
probs = c(0.025, 0.975),
check.stan.diag = TRUE,
verbose = FALSE,
...
)
Arguments
data |
A data frame containing the observations |
trait |
A character representing the name of the column that corresponds to the analysed trait |
model |
An object containing the Bayesian model fitted using |
probs |
A vector with two elements representing the probabilities (in decimal scale) that will be considered for computing the quantiles. |
check.stan.diag |
A logical value indicating whether the function should
extract some diagnostic using native |
verbose |
A logical value. If |
... |
Passed to |
Details
More details about the usage of extr_outs
, as well as the other function of
the ProbBreed
package can be found at https://saulo-chaves.github.io/ProbBreed_site/.
Value
The function returns a list with:
-
post
: a list with the posterior of the effects, and the data generated by the model -
map
: a list with the maximum posterior values of each effect -
ppcheck
: a matrix containing the p-values of maximum, minimum, median, mean and standard deviation; effective number of parameters, WAIC2 value, Rhat and effective sample size. -
plots
: a list with three types of ggplots: histograms, trace plots and density plots. These will be available for all effects declared at theeffects
argument. -
stan_plots
: Ifcheck.stan.diag = TRUE
, a list with plots generated byrstan::stan_diag()
See Also
rstan::stan_diag()
, ggplot2::ggplot()
, rstan::check_hmc_diagnostics()
Examples
mod = bayes_met(data = maize,
gen = "Hybrid",
loc = "Location",
repl = c("Rep", "Block"),
year = NULL,
reg = 'Region',
res.het = FALSE,
trait = 'GY',
iter = 6000, cores = 4, chains = 4)
outs = extr_outs(data = maize, trait = "GY", model = mod,
probs = c(0.05, 0.95),
check.stan.diag = TRUE,
verbose = TRUE)