posterior_plot {tsnet}R Documentation

posterior_plot

Description

Plots posterior distributions of the parameters of the temporal or the contemporaneous networks of a GVAR model. The posterior distributions are visualized as densities in a matrix layout.

Usage

posterior_plot(fitobj, mat = "beta", cis = c(0.8, 0.9, 0.95))

Arguments

fitobj

Fitted model object. This can be a tsnet_fit object (obtained from [stan_gvar()]) or a BGGM object (obtained from [BGGM::var_estimate()]).

mat

A matrix to use for plotting. Possibilities include "beta" (temporal network) and "pcor" (contemporaneous network). Default is "beta" (temporal network).

cis

A numeric vector of credible intervals to use for plotting. Default is c(0.8, 0.9, 0.95).

Details

In the returned plot, posterior distributions for every parameter are shown. Lagged variables are displayed along the vertical line of the grid, and non-lagged variables along the horizontal line of the grids.

Value

A ggplot object representing the posterior distributions of the parameters of the temporal or the contemporaneous networks of a GVAR model.

Examples


# Load simulated time series data
data(ts_data)
example_data <- ts_data[1:100,1:4]

# Estimate a GVAR model
fit <- stan_gvar(example_data, n_chains = 2)

# Extract posterior samples
posterior_plot(fit)


[Package tsnet version 0.1.0 Index]