This function simulates returns based on a Heston-style stochastic volatility process, optionally incorporating jumps (with configurable distributions), microstructure noise, and regime switching via a Markov chain.

generate_synthetic_returns(
  n_days = 252 * 10,
  mu = 2e-04,
  kappa = 0.05,
  theta = 1e-04,
  sigma_v = 0.01,
  rho = -0.7,
  lambda_jump = 0.05,
  jump_size_dist = "normal",
  sigma_jump = 0.02,
  noise_dist = "normal",
  noise_scale = 5e-04,
  noise_df = 5,
  regime_params = NULL,
  random_seed = NULL
)

Arguments

n_days

Number of trading days to simulate (default: 252 * 10).

mu

Drift (mean return) per time step.

kappa

Mean-reversion speed of the variance process.

theta

Long-run average variance.

sigma_v

Volatility of volatility (vol of variance process).

rho

Correlation between volatility and returns (leverage effect).

lambda_jump

Jump intensity (expected jumps per day).

jump_size_dist

Distribution of jump sizes ("normal", "log_normal", or "exponential").

sigma_jump

Scale parameter for jump size distribution.

noise_dist

Type of microstructure noise ("normal" or "student_t").

noise_scale

Standard deviation (or scale) of added microstructure noise.

noise_df

Degrees of freedom for Student-t noise (if used).

regime_params

List specifying regime switching behavior. Includes a transition matrix, and multipliers for `theta` and `kappa` during high-volatility regimes.

random_seed

Optional random seed for reproducibility.

Value

A `data.table` with columns: `date`, `returns`, `variance`, `volatility`, `regime`.