plot_beta_dists {BKTR}R Documentation

Plot Beta Coefficients Distribution

Description

Plot the distribution of beta values for a given list of labels.

Usage

plot_beta_dists(
  bktr_reg,
  labels_list,
  show_figure = TRUE,
  fig_width = 9,
  fig_height = 6,
  fig_resolution = 200
)

Arguments

bktr_reg

BKTRRegressor: BKTRRegressor object.

labels_list

List: List of labels tuple (spatial, temporal, feature) for which to plot the beta distribution through iterations

show_figure

Boolean: Whether to show the figure. Defaults to True.

fig_width

Integer: Figure width. Defaults to 9.

fig_height

Integer: Figure height. Defaults to 6.

fig_resolution

Numeric: Figure resolution PPI. Defaults to 200.

Value

ggplot or NULL: ggplot object or NULL if show_figure is set to FALSE.

Examples


# Launch MCMC sampling on a light version of the BIXI dataset
bixi_data <- BixiData$new(is_light = TRUE)
bktr_regressor <- BKTRRegressor$new(
  data_df <- bixi_data$data_df,
  spatial_positions_df = bixi_data$spatial_positions_df,
  temporal_positions_df = bixi_data$temporal_positions_df,
  burn_in_iter = 5, sampling_iter = 10) # For example only (too few iterations)
bktr_regressor$mcmc_sampling()

# Plot temporal beta coefficients for the first station and the first feature
spa_lab <- bixi_data$spatial_positions_df$location[3]
plot_beta_dists(
  bktr_regressor,
  labels_list = list(
     c(spa_lab, '2019-04-15', 'area_park'),
     c(spa_lab, '2019-04-16', 'area_park'),
     c(spa_lab, '2019-04-16', 'mean_temp_c')
  ),
)


[Package BKTR version 0.1.1 Index]