Skip to contents

This function simulates or reads financial data for the fHMM package.

Usage

prepare_data(controls, true_parameters = NULL, seed = NULL)

Arguments

controls

An object of class fHMM_controls.

true_parameters

An object of class fHMM_parameters, used as simulation parameters.

seed

Set a seed for the data simulation.

Value

An object of class fHMM_data, which is a list containing the following elements:

  • The matrix of the dates if simulated = FALSE and controls$data$data_column is specified,

  • the matrix of the time_points if simulated = TRUE or controls$data$data_column is not specified,

  • the matrix of the simulated markov_chain if simulated = TRUE,

  • the matrix of the simulated or empirical data used for estimation,

  • the matrix time_series of empirical data before the transformation to log-returns if simulated = FALSE,

  • the vector of fine-scale chunk sizes T_star if controls$hierarchy = TRUE,

  • the input controls,

  • the true_parameters.

Examples

controls <- set_controls()
prepare_data(controls)
#> fHMM simulated data