% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/transform_pmf_model_out.R
\name{transform_pmf_model_out}
\alias{transform_pmf_model_out}
\title{Transform pmf model output into a forecast object}
\usage{
transform_pmf_model_out(
  model_out_tbl,
  oracle_output,
  output_type_id_order = NULL
)
}
\arguments{
\item{model_out_tbl}{Model output tibble with predictions}

\item{oracle_output}{Predictions that would have been generated by an oracle
model that knew the observed target data values in advance}

\item{output_type_id_order}{For ordinal variables in pmf format, this is a
vector of levels for pmf forecasts, in increasing order of the levels. The
order of the values for the output_type_id can be found by referencing the
hub's tasks.json configuration file. For all output types other than pmf,
this is ignored.}
}
\value{
A \code{forecast_ordinal} object (when \code{output_type_id_order} is provided)
or a \code{forecast_nominal} object (when \code{output_type_id_order} is \code{NULL}).
}
\description{
Transform pmf model output into a forecast object
}
\examples{
\dontshow{if (requireNamespace("hubExamples", quietly = TRUE)) withAutoprint(\{ # examplesIf}
# Nominal pmf forecast (no output_type_id_order provided)
pmf_outputs <- hubExamples::forecast_outputs |>
  dplyr::filter(.data[["output_type"]] == "pmf")

nominal_forecast <- transform_pmf_model_out(
  model_out_tbl = pmf_outputs,
  oracle_output = hubExamples::forecast_oracle_output
)
nominal_forecast

# Ordinal pmf forecast (output_type_id_order provided)
ordinal_forecast <- transform_pmf_model_out(
  model_out_tbl = pmf_outputs,
  oracle_output = hubExamples::forecast_oracle_output,
  output_type_id_order = c("low", "moderate", "high", "very high")
)
ordinal_forecast
\dontshow{\}) # examplesIf}
}
