transform_results {sectorgap}R Documentation

Format results

Description

Formats the output series into a tibble in long format and computes contribution series.

Usage

transform_results(
  fit,
  data,
  settings,
  estimate = "median",
  HPDIprob = 0.68,
  transformed = TRUE
)

Arguments

fit

fitted object

data

list with at least two named components: prices is a multiple time series object that contains price indices for all relevant series, weights, is a named list of time series with (nominal) weights, the list names correspond to the different groups, i.e., group1, group2, subgroup1, if present in the model

settings

list with model setting, in the format returned by the function initialize_settings

estimate

character specifying the posterior estimate. Valid options are "mean" and "median", the default is estimate = "median".

HPDIprob

probability of highest posterior density interval, the default is HPDIprob = 0.68

transformed

boolean indicating if the transformed series should be used.

Details

data is preferably the output of funtion prepare_data.

Value

A data frame with results in long format.

Examples

data("data_ch")
settings <- initialize_settings()
data <- prepate_data(
  settings = settings,
  tsl = data_ch$tsl,
  tsl_n = data_ch$tsl_n
)
model <- define_ssmodel(
  settings = settings, 
  data = data
)
prior <- initialize_prior(
  model = model, 
  settings = settings
) 

fit <- estimate_ssmodel(
  model = model, 
  settings = settings, 
  data = data,
  prior = prior,
  R = 100
)
df <- transform_results(
  fit = fit, 
  data = data,
  estimate = "median"
)


[Package sectorgap version 0.1.0 Index]