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

PAR <- list(
  
  # Paths. -------------------------------------------------------------------------------
  
  # Current STATPOP release.
  in_pop  = "~/data/appl-wb/01_raw_data/allgemein/go/BEVOELKERUNG/espop.rdata",
  # Current pension 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, by demografic scenario (source: 
  # Thomas Borek @BSV, departement mathematics).
  in_wid  = "~/data/appl-wb/20_staff/kjo/hila_proj/WIDOW_BASISMODELL.csv",
  # Current minimal pension projections.
  in_mp   = "~/data/appl-wb/14_basismodell/12062025/mpen_2025_juni.csv",
  # Current inflation projections.
  in_eck  = "~/data/appl-wb/14_basismodell/12062025/eckwerte_VA26004.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. ---------------------------------------------------------------------
  
  # Selection of demographic scenario edition.
  scen = "2025",
  # Respect 13th AHV pension payment from 2026 onwards.
  ahv13 = TRUE,
  # Include exogenous AHV21 cost vector derived from Delfin.
  ahv21 = TRUE,
  # Deflate results.
  real  = TRUE,
  # 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      ,
      
      # Reform AHV 21.
      2025,   "f",       64 + 1/4,
      2026,   "f",       64 + 2/4,
      2027,   "f",       64 + 3/4,
      2028,   "f",       64 + 4/4,

      2024,   "m",       65
      ),
  # Conduct cross-validation to fix trend extrapolation data ranges for the number of 
  # pension payments abroad as well as the relative mean pension levels both within and
  # without Switzerland.
  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 for CV.
  err = function(pred, obs) abs(pred - obs),
  # Pooling function across pooled k-step error estimates for CV.
  glo = function(x) mean(x),
  # Length out-of-sample prediction horizon during CV.
  out = 10,
  # Path to exogenous projections for the effects of the reform AHV 21, excluding savings  
  # due to the increased reference age of women (source: projection of Delfin model).
  ahv21_cost =
    read_delim(
      "~/data/appl-wb/01_raw_data/ahv/go/Modell_Jörg/ahv21_ausgabeneffekt_ohne_referenzaltererhöhung_juni2025.csv") %>% 
    mutate(cost = cost * 1e6),
  # Save output as '.csv'.
  write = FALSE,
  # Calculate uncertainty bands.
  bands = TRUE
)
