Skip to content

Submission: Tingjun GARCH model updates#16

Merged
Orrell merged 15 commits into
q-variance:mainfrom
tingjun-yang:feature/garch-vol-modeling
Dec 27, 2025
Merged

Submission: Tingjun GARCH model updates#16
Orrell merged 15 commits into
q-variance:mainfrom
tingjun-yang:feature/garch-vol-modeling

Conversation

@tingjun-yang

Copy link
Copy Markdown
Contributor

Hi David,

Thank you for the clarification on the requirements.

Following your instructions, I have re-optimized the model parameters using a 5M-day sample against the theoretical target parameters ($\sigma_0 = 0.2586$ and $z_{off} = 0.0214$). Using the new configuration, I achieved an $R^2$ of 0.997.

I also conducted a convergence study to analyze the relationship between sample size and fit stability. My results show that $R^2$ scales positively with the number of days, consistently stabilizing above 0.995 once the sample exceeds 1M days. This confirms the structural robustness of the parameters against stochastic noise.

Additionally, I implemented a vectorized simulation function using NumPy, which has significantly improved computational speed and allowed for faster iteration across these larger datasets.

I have updated the repository with these findings and look forward to your feedback!

Best regards,
Tingjun Yang

@tingjun-yang

Copy link
Copy Markdown
Contributor Author

Hi @Orrell, sorry I just saw your email about the 0.01 parameter. I am going to address that and update this PR.

@tingjun-yang

Copy link
Copy Markdown
Contributor Author

Ok @Orrell I've updated README.md and declare 0.01 as another parameter Mean Reversion (γ) so the model now has 4 parameters. The results did not change.

@Orrell Orrell merged commit 77d77cd into q-variance:main Dec 27, 2025
1 check passed
@Orrell

Orrell commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

Hi @tingjun-yang To compare your model with standard GARCH I set alpha=0.2475, beta = 0.7425, sigma = 0.095. In standard GARCH the model has omega = (1.0 - alpha - beta) * sigma2_daily while in your model the difference is that omega = (1.0 - beta) * sigma2_daily. So it isn't the same as a standard GARCH model and I was wondering if (a) you had tried optimizing the standard model to compare performance, and (b) if you had a particular motivation for making the change or was it more trial and error?

@tingjun-yang

Copy link
Copy Markdown
Contributor Author

Hi @Orrell, Thanks for your question. I think my notation is a little confusing. I was trying to follow the GARCH model as explained in this article:
In a GARCH(1,1) model, we calculate today's variance ($\sigma_t^2$) using three specific components:
$$\sigma_t^2 = \omega + \alpha \epsilon_{t-1}^2 + \beta \sigma_{t-1}^2$$
Where:
$\sigma_t^2$: Today's predicted variance (how much risk we expect).
$\omega$ (Omega): The Baseline. This is a constant; the long-term average volatility.
$\alpha$ (Alpha): The "Shock" term. It looks at yesterday’s squared return ($\epsilon_{t-1}^2$). If there was a massive market crash yesterday, $\alpha$ makes today's volatility jump.
$\beta$ (Beta): The "Persistence" term. It looks at yesterday’s predicted variance ($\sigma_{t-1}^2$). If volatility was high yesterday, it’s likely to stay high today.

The stability of the GARCH(1,1) model depends on the sum of $\alpha + \beta$:

  • Integrated (IGARCH): $\alpha + \beta = 1$; volatility shocks persist forever.
  • Mean-Reverting: $\alpha + \beta < 1$; volatility returns to its long-run average.

My implementation utilizes the mean-reverting setting. I defined the persistence as $\lambda = \beta$ and the mean-reversion weight as $\gamma = 1 - \alpha - \beta$. To streamline the optimization, I fixed $\gamma$ at $0.01$ and focused on estimating the parameters $\mu$, $\sigma$, and $\lambda$.

@Orrell

Orrell commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

Hi @tingjun-yang Yes, the switch to lambda and gamma makes it harder to compare so maybe I am missing something here, but in your model you have beta (=lambda) = 0.8. Also gamma = 1 - alpha - beta = 0.01 so alpha = 1 - beta - 0.01 = 0.19. In a normal GARCH model you have omega = (1 - alpha - beta) * sigma2_daily = 0.01sigma2_daily, but in yours you have omega = (1 - beta) * sigma2_daily = 0.2sigma2_daily. Is that correct? In any case can I ask that for comparison with other GARCH models you rephrase using parameters alpha and beta (rather than lambda/gamma)? This would make interpretation a lot easier. Thanks, David

@tingjun-yang

Copy link
Copy Markdown
Contributor Author

Hi @Orrell, Thanks for pointing that out. I see what you mean now. Yes, the initial definition of omega was an oversight. I will correct that and use the standard parameter names alpha and beta. I will reoptimize the parameters and submit a PR soon. Thanks!

@Orrell

Orrell commented Dec 28, 2025 via email

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants