###########################
# SET BASELINE PARAMETERS #
###########################

par <- list(
  # Paths. --------------------------------------------------------------------------
  # Current STATPOP release.
  in_pop  = "~/data/appl-wb/01_raw_data/allgemein/go/BEVOELKERUNG/espop.rdata",
  # Current rent registry extract.
  in_rr   = "~/data/appl-wb/01_raw_data/ahv/go/supercube_15042025.csv",
  # Current BFS population scenario.
  in_scen = "~/data/appl-wb/02_data_container/allgemein/go/BEV_SCENARIO.csv",
  # Widow pension projections from complementary model (source: Thomas Borek 
  # @BSV, departement mathematics).
  in_wid  = "~/data/appl-wb/01_raw_data/ahv/go/Modell_Jörg/proj_hila_go.csv",
  # Current minimal pension projections.
  in_mp   = "~/data/appl-wb/14_basismodell/24042025/data/mpen_VA26003.csv",
  # Current inflation projections.
  in_eck  = "~/data/appl-wb/14_basismodell/24042025/data/eckwerte_VA26003.csv",
  # Historical inflation data.
  in_inf  = "~/data/appl-wb/01_raw_data/allgemein/go/PREISINDEX.csv",
  # Current ZAS Abschlussrechnung.
  in_zas  = "~/data/appl-wb/01_raw_data/allgemein/go/sv_ahv_fin.xlsx",
  # Data for Liechtenstein model calculations.
  in_lim  = "~/data/appl-wb/01_raw_data/ahv/go/hist_mort_rent_15042025.csv",
  
  # Parameters. ---------------------------------------------------------------------
  # Respect 13th AHV pension payment from 2026 onwards.
  ahv13 = TRUE,
  # Include exogenous AHV21 cost vector derived from Delfin.
  ahv21 = TRUE,
  # Deflate results.
  real  = FALSE,
  # Return aggregated results (rather than sex-domicile specific ones).
  agg   = TRUE,
  # Projection interval *including* the current year.
  pint  = 2024:2040,
  # Reference ages in multiples of years by sex, starting from GO in current year (first
  # element in parameter 'pint'). Beyond the current year, only dates where changes occur 
  # must be provided.
  reftab =
    tribble(
      ~ year, ~ sex,       ~ refage,
        2024,   "f",       64      ,
      
        2025,   "f",       64 + 1/4,
        2026,   "f",       64 + 2/4,
        2027,   "f",       64 + 3/4,
        2028,   "f",       64 + 4/4,
      
        2024,   "m",       65),
  # Conduct CV to fix parameters.
  cv = FALSE,
  # Admissible value range for number of trend estimation points during CV.
  pr = list("tr" = 4:6, "tot" = 4:6),
  # Pooling function within k-step error estimates.
  err = function(pred, obs) abs(pred - obs),
  # Pooling function across pooled k-step error estimates.
  glo = function(x) mean(x),
  # Length out-of-sample prediction horizon during CV.
  out = 10,
  # Cost differentials due to AHV21 (exogenous Delfin projection).
  ahv21_cost =
    read_delim(
      "~/data/appl-wb/01_raw_data/ahv/go/ahv21_ausgabeneffekt_ohne_referenzaltererhöhung_07052025.csv") %>% 
    mutate(cost = cost * 1e6),
  # Save output.
  write = FALSE,
  # Calculate uncertainty bands.
  bands = FALSE,
  # Simulate Student-t draws and store for resampling.
  sim   = FALSE
)
