average_DAGs {phylopath} | R Documentation |
Perform model averaging on a list of DAGs.
Description
Perform model averaging on a list of DAGs.
Usage
average_DAGs(
fitted_DAGs,
weights = rep(1, length(coef)),
avg_method = "conditional",
...
)
Arguments
fitted_DAGs |
A list of |
weights |
A vector of associated model weights. |
avg_method |
Either |
... |
Use of the ellipses is deprecated. |
Value
An object of class fitted_DAG
, including standard errors and
confidence intervals.
Examples
# Normally, I would advocate the use of the phylo_path and average
# functions, but this code shows how to average any set of models. Note
# that not many checks are implemented, so you may want to be careful and
# make sure the DAGs make sense and contain the same variables!
candidates <- define_model_set(
A = NL ~ BM,
B = NL ~ LS,
.common = c(LS ~ BM, DD ~ NL)
)
fit_cand <- lapply(candidates, est_DAG, rhino, rhino_tree,
model = 'lambda', method = 'logistic_MPLE')
ave_cand <- average_DAGs(fit_cand)
coef_plot(ave_cand)