This function simulates or reads financial data for the fHMM package.
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
ifsimulated = FALSE
andcontrols$data$data_column
is specified,the matrix of the
time_points
ifsimulated = TRUE
orcontrols$data$data_column
is not specified,the matrix of the simulated
markov_chain
ifsimulated = 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 ifsimulated = FALSE
,the vector of fine-scale chunk sizes
T_star
ifcontrols$hierarchy = TRUE
,the input
controls
,the
true_parameters
.
Examples
controls <- set_controls()
prepare_data(controls)
#> fHMM simulated data