filter_fit_locality: Run the filter model for a single locality

Description Usage Arguments Details

View source: R/filter-fit-locality.R

Description

This function requires a metrosamp save file with parameter samples for the locality. An ensemble of models is initialized from these samples, and the filter is run for each ensemble member.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
filter_fit_locality(
  locality,
  inputdir,
  Nens = 100,
  rndselect = NULL,
  inputpfx = "filter-ensemble-candidates-",
  inputsfx = ".rds",
  datemax = NULL,
  history = TRUE
)

Arguments

locality

Either the name of the locality, or the number in the master list. There are 133 localities.

inputdir

Directory containing the input files generated by metrosamp. The file name will be constructed by appending the locality name to the input file prefix.

Nens

Number of ensemble members.

rndselect

Vector of random ensemble members to select (see details).

inputpfx

Stem of input file name. Default is 'filter-ensemble-candidates-'. The name of the locality will be appended to this, followed by the input file suffix.

inputsfx

Suffix appended to the input filename. Default is '.rds'.

datemax

Maximum date to use in the observed data. Default is to exclude the last week if it is incomplete (i.e., daily observations aren't current through the end of the week).

history

Flag indicating whether to keep full results from all ensemble members. If FALSE, keep only median and confidence intervals at each time step, plus final state

Details

The rndselect argument allows one to select random entries from the MCMC samples, consistently across localities (i.e., each locality will get the same parameters for each ensemble member). The input for rndselect should be a vector of Nens random numbers between 0 and 1. These will be converted to integer values in 1:N, where N is the total number of MCMC samples.


rplzzz/CovMitigation documentation built on June 7, 2021, 8:48 a.m.