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: |
settings |
list with model setting, in the format returned by the
function |
estimate |
character specifying the posterior estimate. Valid options
are |
HPDIprob |
probability of highest posterior density interval, the
default is |
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"
)