flat_extrapolation: Flat extrapolation

View source: R/utils-scenarios.R

flat_extrapolationR Documentation

Flat extrapolation

Description

Flat extrapolation

Usage

flat_extrapolation(
  df,
  col,
  group_col = NULL,
  sort_col = "year",
  pred_col = "pred",
  sort_descending = FALSE,
  replace_obs = c("missing", "none")
)

Arguments

df

Data frame of model data

col

Name of column to extrapolate/interpolate.

group_col

Column name(s) of group(s) to use in dplyr::group_by() when supplying type, calculating mean absolute scaled error on data involving time series, and if group_models, then fitting and predicting models too. If NULL, not used. Defaults to "iso3".

sort_col

Column name(s) to use to dplyr::arrange() the data prior to supplying type and calculating mean absolute scaled error on data involving time series. If NULL, not used. Defaults to "year".

pred_col

Column name to store predicted value.

sort_descending

Logical value on whether the sorted values from sort_col should be sorted in descending order. Defaults to FALSE.

replace_obs

Character value specifying how, if at all, observations should be replaced by fitted values. Defaults to replacing only missing values, but can be used to replace all values or none.

Value

a data frame with predicted data,

See Also

General scenario functions add_scenario(), calculate_aarc(), calculate_aroc(), exec_scenario(), fill_cols_scenario(), get_aarr(), get_baseline_value(), get_baseline_year(), get_last_value(), get_last_year_scenario(), get_latest_aarc(), get_percent_change_aarc(), get_target_aarc(), remove_unwanted_scenarios(), trim_values(), trim_years()


gpw13/billionaiRe documentation built on Sept. 27, 2024, 10:05 p.m.