extract_parameter function

Extract Samples for a Parameter from a Stan model

Extract Samples for a Parameter from a Stan model

Extracts a single from a list of stan output and returns it as a <data.table>.

extract_parameter(param, samples, dates)

Arguments

  • param: Character string indicating the parameter to extract
  • samples: Extracted stan model (using rstan::extract())
  • dates: A vector identifying the dimensionality of the parameter to extract. Generally this will be a date.

Returns

A <data.frame> containing the parameter name, date, sample id and sample value.