impute_missing_per_quantile: Impute missing values for each quantile level in a quantile...

View source: R/qra_fit_convenience.R

impute_missing_per_quantileR Documentation

Impute missing values for each quantile level in a quantile forecast matrix It is assumed that in each row, all quantiles for a given model are either missing or available.

Description

Impute missing values for each quantile level in a quantile forecast matrix It is assumed that in each row, all quantiles for a given model are either missing or available.

Usage

impute_missing_per_quantile(
  qfm,
  impute_method = "mean",
  weight_transfer_per_group = FALSE,
  weight_transfer_group_factors = "location",
  imputed_qfm_only = FALSE
)

Arguments

qfm

a QuantileForecastMatrix

impute_method

character string specifying method for imputing missing forecasts; either 'mean' for mean imputation or 'none' for no imputation

weight_transfer_per_group

logical indicating whether to compute weight transfer matrices for every group defined by ‘weight_transfer_group_factors’

weight_transfer_group_factors

string vector of these factors with only "locations" as default. Ignored if weight_transfer_per_group is FALSE

imputed_qfm_only

if TRUE, return only imputed QuantileForecastMatrix

Value

if imputed_qfm_only is TRUE, 'qfm_imputed', the input QuantileForecastMatrix object with missing values imputed

otherwise a list of two items:

  1. 'qfm_imputed'

  2. if weight_transfer_per_group is FALSE, 'weight_transfer', a square matrix of dimension equal to the number of unique models in qfm. Entry i, j is the proportion of imputed observations for model j that are attributable to model i. if weight_transfer_per_group is TRUE, a data frame having a column for each factor and a list-column of the corresponding weight transfer matrices whose entries give within-group proportions.


reichlab/covidEnsembles documentation built on Jan. 31, 2024, 7:21 p.m.