The purpose of this project was to investigate the strategy of selling shares of Akamai Technologies (AKAM) using the tools and techniques learned in the course Financial Econometrics in Social Sciences using R. The impetus for taking up this topic was personal motivation - my friend bought shares of Akamai, and I, out of sheer curiosity, decided to see if it was possible to create a simple, empirically based strategy for determining the timing of an exit based on analysis of financial data.
The project used empirical daily data of Akamai’s stock quotes from 2020 to today. The analysis began with an exploration of the distribution of logarithmic returns (including Jarque-Bera test, Ljung-Box tests, ARCH-LM test) to test the underlying statistical assumptions. Next, the focus was on volatility modeling, using the classic GARCH(1,1) model with a t-distribution of innovations. The GARCH model was estimated using the maximum likelihood method, and its quality was assessed using criterion information (AIC, BIC), diagnostic tests and residual analysis. On this basis, a simple volatility exit investment strategy was constructed, which involved selling stocks when the forecasted volatility exceeded a set threshold (e.g., 75th percentile). The strategy was compared with a passive Buy & Hold approach, analyzing cumulative returns, daily returns and maximum capital slips.
Akamai Technologies, Inc. is a U.S.-based technology company specializing in cloud services, cybersecurity and Content Delivery Network (CDN), the delivery of web content in a fast and secure manner. Its infrastructure underpins the operation of thousands of websites and applications around the world - Akamai handles traffic for media companies, e-commerce and financial institutions, among others.
The following histogram compares the empirical distribution of Akamai’s standardized daily returns with both the normal distribution (blue line) and the Student’s t-distribution with 5 degrees of freedom (orange line).
##
## Jarque Bera Test
##
## data: akam_returns
## X-squared = 29011, df = 2, p-value < 2.2e-16
##
## Box-Ljung test
##
## data: akam_returns
## X-squared = 14.372, df = 10, p-value = 0.1567
##
## ARCH LM-test; Null hypothesis: no ARCH effects
##
## data: akam_returns
## Chi-squared = 9.4819, df = 10, p-value = 0.4871
Akamai’s stock returns do not show autocorrelation at the 10 lag level,
The data can be treated as whitespace in terms of returns,
##
## *---------------------------------*
## * GARCH Model Fit *
## *---------------------------------*
##
## Conditional Variance Dynamics
## -----------------------------------
## GARCH Model : sGARCH(1,1)
## Mean Model : ARFIMA(0,0,0)
## Distribution : std
##
## Optimal Parameters
## ------------------------------------
## Estimate Std. Error t value Pr(>|t|)
## mu 0.000927 0.000346 2.6803 0.007355
## omega 0.000031 0.000011 2.8498 0.004375
## alpha1 0.130247 0.038747 3.3615 0.000775
## beta1 0.814069 0.045137 18.0356 0.000000
## shape 3.017674 0.262851 11.4805 0.000000
##
## Robust Standard Errors:
## Estimate Std. Error t value Pr(>|t|)
## mu 0.000927 0.000334 2.7722 0.005569
## omega 0.000031 0.000013 2.3689 0.017840
## alpha1 0.130247 0.056183 2.3183 0.020434
## beta1 0.814069 0.060950 13.3562 0.000000
## shape 3.017674 0.292425 10.3195 0.000000
##
## LogLikelihood : 3718.832
##
## Information Criteria
## ------------------------------------
##
## Akaike -5.4455
## Bayes -5.4264
## Shibata -5.4455
## Hannan-Quinn -5.4383
##
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 1.225 0.2683
## Lag[2*(p+q)+(p+q)-1][2] 1.435 0.3763
## Lag[4*(p+q)+(p+q)-1][5] 2.291 0.5515
## d.o.f=0
## H0 : No serial correlation
##
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 0.01369 0.9069
## Lag[2*(p+q)+(p+q)-1][5] 0.20737 0.9920
## Lag[4*(p+q)+(p+q)-1][9] 0.46321 0.9988
## d.o.f=2
##
## Weighted ARCH LM Tests
## ------------------------------------
## Statistic Shape Scale P-Value
## ARCH Lag[3] 0.1417 0.500 2.000 0.7066
## ARCH Lag[5] 0.3376 1.440 1.667 0.9301
## ARCH Lag[7] 0.5274 2.315 1.543 0.9758
##
## Nyblom stability test
## ------------------------------------
## Joint Statistic: 2.8787
## Individual Statistics:
## mu 0.1198
## omega 0.4139
## alpha1 1.6695
## beta1 0.7344
## shape 1.3338
##
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic: 1.28 1.47 1.88
## Individual Statistic: 0.35 0.47 0.75
##
## Sign Bias Test
## ------------------------------------
## t-value prob sig
## Sign Bias 0.6499 0.5159
## Negative Sign Bias 0.3490 0.7271
## Positive Sign Bias 0.2153 0.8296
## Joint Effect 1.5258 0.6763
##
##
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
## group statistic p-value(g-1)
## 1 20 18.96 0.4593
## 2 30 27.88 0.5245
## 3 40 42.33 0.3291
## 4 50 57.26 0.1954
##
##
## Elapsed time : 0.1860051
##
## Box-Ljung test
##
## data: resids
## X-squared = 14.573, df = 20, p-value = 0.8003
##
## Box-Ljung test
##
## data: resids^2
## X-squared = 1.8582, df = 20, p-value = 1
##
## Jarque Bera Test
##
## data: resids
## X-squared = 63648, df = 2, p-value < 2.2e-16
##
## Akaike -5.445502
## Bayes -5.426374
## Shibata -5.445529
## Hannan-Quinn -5.438342
##
## Akaike -5.397792
## Bayes -5.374838
## Shibata -5.397830
## Hannan-Quinn -5.389200
Based on information criteria, GARCH(1,1) with Student-t innovations is selected for further analysis.
Below project focuses on designing, implementing, and analyzing a trading strategy based on forecasted market volatility using the GARCH(1,1) model. The core idea is to exit the market when risk (volatility) is high and re-enter when it’s low — a concept we refer to as the “Volatility Exit” strategy.
## Strategy Buy...Hold
## Observations 199.0000 199.0000
## NAs 0.0000 0.0000
## Minimum -0.2450 -0.2450
## Quartile 1 -0.0048 -0.0092
## Median 0.0000 0.0009
## Arithmetic Mean -0.0023 -0.0015
## Geometric Mean -0.0026 -0.0019
## Quartile 3 0.0068 0.0100
## Maximum 0.0407 0.1127
## SE Mean 0.0018 0.0021
## LCL Mean (0.95) -0.0059 -0.0055
## UCL Mean (0.95) 0.0013 0.0026
## Variance 0.0007 0.0008
## Stdev 0.0256 0.0290
## Skewness -5.8084 -3.7186
## Kurtosis 46.5246 28.9994
From August to November 2024, both strategies perform similarly. In November–December 2024, the strategy exits during a period of high volatility and avoids losses.In early 2025, the strategy misses a recovery phase, reflected by the flat black line, while Buy & Hold rebounds with high volatility.
The strategy limits exposure to turbulent days, leading to lower volatility.
The strategy significantly reduces drawdown risk.
1 (hold) to 0
(exit).This strategy forms a solid foundation for risk-aware trading. It’s designed not to beat the market in all cases but to avoid large losses while remaining exposed during calmer periods.