gen_bank: Generate a bank of time series for use in a Near Unit...

Description Usage Arguments Value Author(s) Examples

View source: R/gen_bank.R

Description

Returns a list object of time series objects with their attributes. Whether a time series has a unit root is drawn at random based on a sampling probability (sample_prob). The length of the series is randomly drawn between t_min and t_max. The type of unit root process follows standard DGPs which can be calibrated and the split of each DGP can be controlled.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
gen_bank(
  iter = 5e+05,
  sample_prob = 0.5,
  t = c(5, 50),
  freq = 12,
  nur_ur = c(0.9, 0.99999),
  run_par = TRUE,
  dgp_params = list(dgp = "dgp_enders1", periods = 100, sd = 1, alpha0 = 1, alpha2 =
    0.005, gamma = 1)
)

Arguments

iter

The number of series that will be generated.

sample_prob

The probability of that a unit root exists in the sample. For example, 0.5 would indicate 50% of series have a unit root.

t

A vector of length 2 that contains the minimum and maximum number of periods (default = c(5,50))

freq

Time series frequency (default = 12)

nur_ur

A vector of length 2 that contains the Phi domain (default = c(0.9, 0.99999))

run_par

Boolean indicating whether to compute in parallel.

dgp_params

A list object indicating which DGPs will be used and in what proportion within the sample_prob (see DGP functions). The basic DGP should include a tag "dgp" with a string value indicating which dgp function (e.g. "dgp_enders1", "dgp_engle") and the arguments required to execute the function. The parameters "period" will be handled by "t" and "gamma" is a function of the "sample_prob" parameter. Note that this function that DGPs will be evenly split amongst the sample_prob. For example, if sample_prob = 0.5 and two DGPs are specified, 25% of the overall sample will be generated using each DGP.

Value

A list object

Author(s)

Gary Cornwall and Jeffrey Chen

Examples

1
2
3
4
5
6
7
8
#Generate a new time series
gen_bank(iter = 300,
        dgp_params = list(dgp = "dgp_enders1",
                          periods = 100,
                          sd = 1,
                          alpha0 = 1,
                          alpha2 =  .005,
                          gamma = 1))

DataScienceForPublicPolicy/hypML documentation built on Dec. 17, 2021, 4:06 p.m.