Learn R Programming

bdsm (version 0.1.1)

bma_summary: Summary of a model space

Description

A summary of a given model space is prepared. This include things such as posterior inclusion probability (PIP), posterior mean and so on. This is the core function of the package, because it allows to make assessments and decisions about the parameters and models.

Usage

bma_summary(
  df,
  dep_var_col,
  timestamp_col,
  entity_col,
  model_space,
  exact_value = TRUE,
  model_prior = "uniform",
  run_parallel = FALSE
)

Value

List of parameters describing analyzed models

Arguments

df

Data frame with data for the SEM analysis.

dep_var_col

Column with the dependent variable

timestamp_col

The name of the column with timestamps

entity_col

Column with entities (e.g. countries)

model_space

A matrix (with named rows) with each column corresponding to a model. Each column specifies model parameters. Compare with optimal_model_space

exact_value

Whether the exact value of the likelihood should be computed (TRUE) or just the proportional part (FALSE). Check SEM_likelihood for details.

model_prior

Which model prior to use. For now there are two options: 'uniform' and 'binomial-beta'. Default is 'uniform'.

run_parallel

If TRUE the optimization is run in parallel using the parApply function. If FALSE (default value) the base apply function is used. Note that using the parallel computing requires setting the default cluster. See README.

Examples

Run this code
# \donttest{
library(magrittr)

data_prepared <- economic_growth[,1:7] %>%
   feature_standardization(timestamp_col = year, entity_col = country) %>%
   feature_standardization(timestamp_col = year, entity_col = country,
                           time_effects = TRUE, scale = FALSE)


bma_result <- bma_summary(df = data_prepared, dep_var_col = gdp,
                          timestamp_col = year, entity_col = country,
                          model_space = economic_growth_ms)
# }

Run the code above in your browser using DataLab