library(tidyverse)
library(readxl)
library(forecast)
library(rugarch)
library(FinTS)
ruta <- 'FF3_monthly_csv.xltx'
ff3_data <- read_excel(ruta)
colnames(ff3_data)## [1] "Date" "Mkt-RF" "SMB" "HML" "RF"
## Date Mkt-RF SMB HML
## Min. :192607 Min. :-29.1300 Min. :-17.2000 Min. :-13.8800
## 1st Qu.:195102 1st Qu.: -2.0150 1st Qu.: -1.6500 1st Qu.: -1.4200
## Median :197510 Median : 1.0650 Median : 0.0700 Median : 0.1200
## Mean :197531 Mean : 0.6865 Mean : 0.1769 Mean : 0.3385
## 3rd Qu.:200005 3rd Qu.: 3.6500 3rd Qu.: 1.7475 3rd Qu.: 1.7500
## Max. :202412 Max. : 38.8500 Max. : 36.5600 Max. : 35.6100
## RF
## Min. :-0.0600
## 1st Qu.: 0.0300
## Median : 0.2300
## Mean : 0.2693
## 3rd Qu.: 0.4200
## Max. : 1.3500
ff3_data <- ff3_data %>%
mutate(
log_ret = log(1 + `Mkt-RF` / 100), # Rendimiento logarítmico
log_ret_sq = log_ret^2 # Rendimiento logarítmico al cuadrado
)No cuenta con autocorrelacion significativa, informacion que se corrobora con el PACF, ya que tampoco demuestra relacion autoregresiva. No se observa dependencia lineal.
En los rendimientos al cuadrado el ACF muestra una gran dependencia temporal y en el PACF muestra una gran cantidad de rezagos, demostrando dependencia lineal.
# Especificación del modelo AR(3) para la media y GARCH(1,1) para la varianza
spec <- ugarchspec(
variance.model = list(model = "sGARCH", garchOrder = c(1, 1)),
mean.model = list(armaOrder = c(3, 0), include.mean = TRUE),
distribution.model = "norm" # distribución normal
)
# Estimación del modelo usando la columna log_ret
fit <- ugarchfit(spec = spec, data = ff3_data$log_ret)
# Mostrar resultados
show(fit)##
## *---------------------------------*
## * GARCH Model Fit *
## *---------------------------------*
##
## Conditional Variance Dynamics
## -----------------------------------
## GARCH Model : sGARCH(1,1)
## Mean Model : ARFIMA(3,0,0)
## Distribution : norm
##
## Optimal Parameters
## ------------------------------------
## Estimate Std. Error t value Pr(>|t|)
## mu 0.007103 0.001256 5.65355 0.000000
## ar1 0.056703 0.031501 1.80005 0.071853
## ar2 -0.016926 0.031625 -0.53521 0.592507
## ar3 0.006166 0.030665 0.20109 0.840631
## omega 0.000073 0.000022 3.32593 0.000881
## alpha1 0.133372 0.020623 6.46725 0.000000
## beta1 0.846756 0.019298 43.87839 0.000000
##
## Robust Standard Errors:
## Estimate Std. Error t value Pr(>|t|)
## mu 0.007103 0.001332 5.33105 0.000000
## ar1 0.056703 0.035386 1.60240 0.109067
## ar2 -0.016926 0.031902 -0.53055 0.595731
## ar3 0.006166 0.028408 0.21706 0.828160
## omega 0.000073 0.000028 2.63293 0.008465
## alpha1 0.133372 0.027339 4.87851 0.000001
## beta1 0.846756 0.026932 31.44017 0.000000
##
## LogLikelihood : 1948.631
##
## Information Criteria
## ------------------------------------
##
## Akaike -3.2853
## Bayes -3.2553
## Shibata -3.2854
## Hannan-Quinn -3.2740
##
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 0.01735 0.8952
## Lag[2*(p+q)+(p+q)-1][8] 4.86489 0.2658
## Lag[4*(p+q)+(p+q)-1][14] 8.43808 0.3002
## d.o.f=3
## H0 : No serial correlation
##
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 0.1172 0.7321
## Lag[2*(p+q)+(p+q)-1][5] 0.8806 0.8861
## Lag[4*(p+q)+(p+q)-1][9] 1.6782 0.9397
## d.o.f=2
##
## Weighted ARCH LM Tests
## ------------------------------------
## Statistic Shape Scale P-Value
## ARCH Lag[3] 0.008227 0.500 2.000 0.9277
## ARCH Lag[5] 0.535719 1.440 1.667 0.8730
## ARCH Lag[7] 1.007932 2.315 1.543 0.9123
##
## Nyblom stability test
## ------------------------------------
## Joint Statistic: 0.8402
## Individual Statistics:
## mu 0.14537
## ar1 0.19974
## ar2 0.05535
## ar3 0.05773
## omega 0.07663
## alpha1 0.13588
## beta1 0.12166
##
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic: 1.69 1.9 2.35
## Individual Statistic: 0.35 0.47 0.75
##
## Sign Bias Test
## ------------------------------------
## t-value prob sig
## Sign Bias 3.1985 1.418e-03 ***
## Negative Sign Bias 0.5652 5.721e-01
## Positive Sign Bias 1.2360 2.167e-01
## Joint Effect 26.8821 6.232e-06 ***
##
##
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
## group statistic p-value(g-1)
## 1 20 56.75 1.250e-05
## 2 30 56.38 1.706e-03
## 3 40 71.67 1.103e-03
## 4 50 95.07 8.831e-05
##
##
## Elapsed time : 0.293802
##
## please wait...calculating quantiles...
##
## please wait...calculating quantiles...
Ningun coeficiente ar es significativo por lo que no hay evidencias de dependecia, ademas, al no ser significativas se puede optar por un modelo mas sencillo
spec_simple <- ugarchspec(
variance.model = list(model = "sGARCH", garchOrder = c(1, 1)),
mean.model = list(armaOrder = c(0, 0), include.mean = TRUE),
distribution.model = "norm"
)
fit_simple <- ugarchfit(spec = spec_simple, data = ff3_data$log_ret)
show(fit_simple)##
## *---------------------------------*
## * GARCH Model Fit *
## *---------------------------------*
##
## Conditional Variance Dynamics
## -----------------------------------
## GARCH Model : sGARCH(1,1)
## Mean Model : ARFIMA(0,0,0)
## Distribution : norm
##
## Optimal Parameters
## ------------------------------------
## Estimate Std. Error t value Pr(>|t|)
## mu 0.007129 0.001206 5.9102 0.00000
## omega 0.000074 0.000022 3.3564 0.00079
## alpha1 0.134745 0.020695 6.5110 0.00000
## beta1 0.845472 0.019246 43.9301 0.00000
##
## Robust Standard Errors:
## Estimate Std. Error t value Pr(>|t|)
## mu 0.007129 0.001346 5.2980 0.000000
## omega 0.000074 0.000028 2.6152 0.008917
## alpha1 0.134745 0.027811 4.8450 0.000001
## beta1 0.845472 0.027493 30.7526 0.000000
##
## LogLikelihood : 1947.376
##
## Information Criteria
## ------------------------------------
##
## Akaike -3.2883
## Bayes -3.2711
## Shibata -3.2883
## Hannan-Quinn -3.2818
##
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 2.407 0.1208
## Lag[2*(p+q)+(p+q)-1][2] 2.409 0.2031
## Lag[4*(p+q)+(p+q)-1][5] 4.160 0.2348
## d.o.f=0
## H0 : No serial correlation
##
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 0.1296 0.7188
## Lag[2*(p+q)+(p+q)-1][5] 0.8692 0.8885
## Lag[4*(p+q)+(p+q)-1][9] 1.6226 0.9449
## d.o.f=2
##
## Weighted ARCH LM Tests
## ------------------------------------
## Statistic Shape Scale P-Value
## ARCH Lag[3] 2.591e-05 0.500 2.000 0.9959
## ARCH Lag[5] 4.222e-01 1.440 1.667 0.9063
## ARCH Lag[7] 8.932e-01 2.315 1.543 0.9303
##
## Nyblom stability test
## ------------------------------------
## Joint Statistic: 0.5485
## Individual Statistics:
## mu 0.16162
## omega 0.07887
## alpha1 0.13692
## beta1 0.12421
##
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic: 1.07 1.24 1.6
## Individual Statistic: 0.35 0.47 0.75
##
## Sign Bias Test
## ------------------------------------
## t-value prob sig
## Sign Bias 3.7997 1.523e-04 ***
## Negative Sign Bias 0.9395 3.477e-01
## Positive Sign Bias 0.9708 3.318e-01
## Joint Effect 31.0694 8.219e-07 ***
##
##
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
## group statistic p-value(g-1)
## 1 20 66.09 4.060e-07
## 2 30 77.29 2.867e-06
## 3 40 89.20 8.364e-06
## 4 50 104.80 6.227e-06
##
##
## Elapsed time : 0.122823
# Extraer coeficientes directamente del modelo estimado
coefs <- coef(fit)
# Extraer omega, alpha1 y beta1 del objeto
omega <- coefs["omega"]
alpha1 <- coefs["alpha1"]
beta1 <- coefs["beta1"]
# Calcular la varianza no condicional
var_no_cond <- omega / (1 - alpha1 - beta1)
var_no_cond## omega
## 0.003681973
Se estima que la Varianza no condicional es de 0.37%
# Definir especificación del modelo GARCH(1,1) con media constante
spec_garch <- ugarchspec(
variance.model = list(model = "sGARCH", garchOrder = c(1,1)),
mean.model = list(armaOrder = c(0,0), include.mean = TRUE),
distribution.model = "norm"
)
# Estimar el modelo
fit_garch <- ugarchfit(spec = spec_garch, data = ff3_data$log_ret)
# Mostrar resultados
fit_garch##
## *---------------------------------*
## * GARCH Model Fit *
## *---------------------------------*
##
## Conditional Variance Dynamics
## -----------------------------------
## GARCH Model : sGARCH(1,1)
## Mean Model : ARFIMA(0,0,0)
## Distribution : norm
##
## Optimal Parameters
## ------------------------------------
## Estimate Std. Error t value Pr(>|t|)
## mu 0.007129 0.001206 5.9102 0.00000
## omega 0.000074 0.000022 3.3564 0.00079
## alpha1 0.134745 0.020695 6.5110 0.00000
## beta1 0.845472 0.019246 43.9301 0.00000
##
## Robust Standard Errors:
## Estimate Std. Error t value Pr(>|t|)
## mu 0.007129 0.001346 5.2980 0.000000
## omega 0.000074 0.000028 2.6152 0.008917
## alpha1 0.134745 0.027811 4.8450 0.000001
## beta1 0.845472 0.027493 30.7526 0.000000
##
## LogLikelihood : 1947.376
##
## Information Criteria
## ------------------------------------
##
## Akaike -3.2883
## Bayes -3.2711
## Shibata -3.2883
## Hannan-Quinn -3.2818
##
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 2.407 0.1208
## Lag[2*(p+q)+(p+q)-1][2] 2.409 0.2031
## Lag[4*(p+q)+(p+q)-1][5] 4.160 0.2348
## d.o.f=0
## H0 : No serial correlation
##
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 0.1296 0.7188
## Lag[2*(p+q)+(p+q)-1][5] 0.8692 0.8885
## Lag[4*(p+q)+(p+q)-1][9] 1.6226 0.9449
## d.o.f=2
##
## Weighted ARCH LM Tests
## ------------------------------------
## Statistic Shape Scale P-Value
## ARCH Lag[3] 2.591e-05 0.500 2.000 0.9959
## ARCH Lag[5] 4.222e-01 1.440 1.667 0.9063
## ARCH Lag[7] 8.932e-01 2.315 1.543 0.9303
##
## Nyblom stability test
## ------------------------------------
## Joint Statistic: 0.5485
## Individual Statistics:
## mu 0.16162
## omega 0.07887
## alpha1 0.13692
## beta1 0.12421
##
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic: 1.07 1.24 1.6
## Individual Statistic: 0.35 0.47 0.75
##
## Sign Bias Test
## ------------------------------------
## t-value prob sig
## Sign Bias 3.7997 1.523e-04 ***
## Negative Sign Bias 0.9395 3.477e-01
## Positive Sign Bias 0.9708 3.318e-01
## Joint Effect 31.0694 8.219e-07 ***
##
##
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
## group statistic p-value(g-1)
## 1 20 66.09 4.060e-07
## 2 30 77.29 2.867e-06
## 3 40 89.20 8.364e-06
## 4 50 104.80 6.227e-06
##
##
## Elapsed time : 0.102833
##
## Jarque Bera Test
##
## data: resid_std
## X-squared = 427.35, df = 2, p-value < 2.2e-16
##
## Shapiro-Wilk normality test
##
## data: as.numeric(resid_std)
## W = 0.96456, p-value = 2.223e-16
##
## Box-Ljung test
##
## data: resid_std
## X-squared = 27.614, df = 20, p-value = 0.1189
##
## ARCH LM-test; Null hypothesis: no ARCH effects
##
## data: resid_std
## Chi-squared = 4.6661, df = 12, p-value = 0.9682
La serie no cuenta con autocorrelacion y no cuenta con problemas ARCH, por lo que capta la heterocedasticidad. Por otra parte los residuos no siguen una distribución normal,lo que puede indicar la presencia de leptocurtosis
# Especificar el modelo AR(3) - GARCH(1,1) con distribución t-student
spec_garch_t <- ugarchspec(
variance.model = list(model = "sGARCH", garchOrder = c(1,1)),
mean.model = list(armaOrder = c(3,0), include.mean = TRUE),
distribution.model = "std" # "std" para t de Student
)
# Ajuste del modelo con t-student
fit_garch_t <- ugarchfit(spec = spec_garch_t, data = ff3_data$log_ret)
# Ver resumen del modelo
show(fit_garch_t)##
## *---------------------------------*
## * GARCH Model Fit *
## *---------------------------------*
##
## Conditional Variance Dynamics
## -----------------------------------
## GARCH Model : sGARCH(1,1)
## Mean Model : ARFIMA(3,0,0)
## Distribution : std
##
## Optimal Parameters
## ------------------------------------
## Estimate Std. Error t value Pr(>|t|)
## mu 0.009281 0.001191 7.789879 0.000000
## ar1 0.018534 0.030845 0.600883 0.547918
## ar2 -0.000100 0.030192 -0.003313 0.997357
## ar3 -0.003745 0.029859 -0.125438 0.900177
## omega 0.000109 0.000036 3.027070 0.002469
## alpha1 0.135732 0.027910 4.863233 0.000001
## beta1 0.826326 0.030851 26.784786 0.000000
## shape 6.696669 1.197140 5.593890 0.000000
##
## Robust Standard Errors:
## Estimate Std. Error t value Pr(>|t|)
## mu 0.009281 0.001324 7.009244 0.000000
## ar1 0.018534 0.031735 0.584033 0.559198
## ar2 -0.000100 0.029484 -0.003392 0.997293
## ar3 -0.003745 0.027371 -0.136839 0.891158
## omega 0.000109 0.000034 3.192269 0.001412
## alpha1 0.135732 0.027662 4.906888 0.000001
## beta1 0.826326 0.026964 30.645356 0.000000
## shape 6.696669 1.383871 4.839085 0.000001
##
## LogLikelihood : 1979.368
##
## Information Criteria
## ------------------------------------
##
## Akaike -3.3356
## Bayes -3.3013
## Shibata -3.3357
## Hannan-Quinn -3.3227
##
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 0.9208 0.3373
## Lag[2*(p+q)+(p+q)-1][8] 5.2590 0.1111
## Lag[4*(p+q)+(p+q)-1][14] 8.7208 0.2586
## d.o.f=3
## H0 : No serial correlation
##
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 0.06724 0.7954
## Lag[2*(p+q)+(p+q)-1][5] 0.99066 0.8618
## Lag[4*(p+q)+(p+q)-1][9] 1.70873 0.9368
## d.o.f=2
##
## Weighted ARCH LM Tests
## ------------------------------------
## Statistic Shape Scale P-Value
## ARCH Lag[3] 0.0001149 0.500 2.000 0.9914
## ARCH Lag[5] 0.4467507 1.440 1.667 0.8992
## ARCH Lag[7] 0.8137254 2.315 1.543 0.9419
##
## Nyblom stability test
## ------------------------------------
## Joint Statistic: 1.364
## Individual Statistics:
## mu 0.17393
## ar1 0.33792
## ar2 0.17636
## ar3 0.06360
## omega 0.18366
## alpha1 0.21534
## beta1 0.26417
## shape 0.05701
##
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic: 1.89 2.11 2.59
## Individual Statistic: 0.35 0.47 0.75
##
## Sign Bias Test
## ------------------------------------
## t-value prob sig
## Sign Bias 3.3182 9.337e-04 ***
## Negative Sign Bias 0.6047 5.455e-01
## Positive Sign Bias 0.9053 3.655e-01
## Joint Effect 25.2086 1.397e-05 ***
##
##
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
## group statistic p-value(g-1)
## 1 20 55.97 1.649e-05
## 2 30 59.68 6.778e-04
## 3 40 76.95 2.761e-04
## 4 50 90.00 3.233e-04
##
##
## Elapsed time : 0.3211441
# Pronóstico de 1 período adelante
forecast_t <- ugarchforecast(fit_garch_t, n.ahead = 1)
# Rendimiento esperado
rend_esperado <- forecast_t@forecast$seriesFor
# Varianza condicional esperada
var_esperada <- forecast_t@forecast$sigmaFor^2
# Mostrar resultados
rend_esperado## 1973-03-28
## T+1 0.008577636
## 1973-03-28
## T+1 0.001636439
La razon principal por la cual la t-student es una buena distribucion para la serie debido a la necesidad de evitar la acusacion de leptocurtosis, ya que las colas pesadas no bien leidas con la distribucion normal, mientras que con la t-student son bien leidos y encajan de mejor manera con el modelo. La t-student no presenta autocorrelacion ni heterocedasticidad, por lo que demuestra que es una buena distribucion para modelar la serie.
Se obtuvo un pronostico de 0,86% mensual, con varianza condicional de 0.001636439, lo que refleja un mercado positivo con volatilidad controlada en corto plazo.
###El modelo GARCH-M es el que incorpora la dependencia del rendimiento con respecto a la volatilidad.
spec_garch_m <- ugarchspec(
variance.model = list(model = "sGARCH", garchOrder = c(1,1)),
mean.model = list(armaOrder = c(0,0), include.mean = TRUE, archm = TRUE, archpow = 0.5),
distribution.model = "std"
)
fit_garch_m <- ugarchfit(spec = spec_garch_m, data = ff3_data$log_ret)
show(fit_garch_m)##
## *---------------------------------*
## * 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.009326 0.001173 7.9533 0.000000
## omega 0.000111 0.000036 3.0473 0.002309
## alpha1 0.137943 0.028173 4.8963 0.000001
## beta1 0.823727 0.031053 26.5263 0.000000
## shape 6.677854 1.181114 5.6539 0.000000
##
## Robust Standard Errors:
## Estimate Std. Error t value Pr(>|t|)
## mu 0.009326 0.001304 7.1499 0.000000
## omega 0.000111 0.000034 3.2103 0.001326
## alpha1 0.137943 0.027811 4.9599 0.000001
## beta1 0.823727 0.026918 30.6010 0.000000
## shape 6.677854 1.351251 4.9420 0.000001
##
## LogLikelihood : 1979.567
##
## Information Criteria
## ------------------------------------
##
## Akaike -3.3411
## Bayes -3.3196
## Shibata -3.3411
## Hannan-Quinn -3.3330
##
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 2.186 0.1393
## Lag[2*(p+q)+(p+q)-1][2] 2.186 0.2337
## Lag[4*(p+q)+(p+q)-1][5] 3.832 0.2757
## d.o.f=0
## H0 : No serial correlation
##
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 0.07302 0.7870
## Lag[2*(p+q)+(p+q)-1][5] 1.02292 0.8545
## Lag[4*(p+q)+(p+q)-1][9] 1.74422 0.9332
## d.o.f=2
##
## Weighted ARCH LM Tests
## ------------------------------------
## Statistic Shape Scale P-Value
## ARCH Lag[3] 0.001045 0.500 2.000 0.9742
## ARCH Lag[5] 0.441335 1.440 1.667 0.9008
## ARCH Lag[7] 0.817540 2.315 1.543 0.9413
##
## Nyblom stability test
## ------------------------------------
## Joint Statistic: 0.7609
## Individual Statistics:
## mu 0.18255
## omega 0.18740
## alpha1 0.22077
## beta1 0.26733
## shape 0.06216
##
## 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 3.3446 8.501e-04 ***
## Negative Sign Bias 0.6391 5.229e-01
## Positive Sign Bias 0.8889 3.742e-01
## Joint Effect 25.2614 1.361e-05 ***
##
##
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
## group statistic p-value(g-1)
## 1 20 53.57 3.843e-05
## 2 30 56.12 1.828e-03
## 3 40 73.84 6.311e-04
## 4 50 87.04 6.685e-04
##
##
## Elapsed time : 0.165992
Todos los coeficientes son altamente significativos. El modelo está bien especificado, los choques tienen un efecto persistente y se ajusta adecuadamente a la leptocurtosis observada en los datos financieros. No hay autocorrelación en los residuos ni en los residuos al cuadrado, no hay evidencia de efectos ARCH residuales. El modelo capta bien la heterocedasticidad, no hay dependencia serial ni heterocedasticidad remanente.Por lo que se podria decir que el modelo es adecuado. El Joint Statistic (0.76) es menor a los valores críticos de 10%, 5% y 1%, por lo tanto:No hay evidencia de inestabilidad estructural en los parámetros. Sign Bias (positivo) y Joint Effect son significativos El modelo tiene dificultades para capturar completamente la asimetría entre choques positivos y negativos. Esto sugiere que sería conveniente pasar a un modelo GJR-GARCH. Las estadísticas de los grupos (20, 30, 40, 50) muestran p-valores bajos, lo que sugiere que el ajuste no es perfecto.
###“Modelo GARCH asimétrico, incorpora el efecto diferencial de choques positivos y negativos sobre la volatilidad condicional.”
#Glosten-Jagannathan-Runkle GARCH
# Especificar modelo GJR-GARCH(1,1) con t-student
spec_gjr <- ugarchspec(
variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)),
mean.model = list(armaOrder = c(0, 0), include.mean = TRUE),
distribution.model = "std"
)
# Ajustar el modelo con los datos
fit_gjr <- ugarchfit(spec = spec_gjr, data = ff3_data$log_ret)
# Mostrar resultados del ajuste
show(fit_gjr)##
## *---------------------------------*
## * GARCH Model Fit *
## *---------------------------------*
##
## Conditional Variance Dynamics
## -----------------------------------
## GARCH Model : gjrGARCH(1,1)
## Mean Model : ARFIMA(0,0,0)
## Distribution : std
##
## Optimal Parameters
## ------------------------------------
## Estimate Std. Error t value Pr(>|t|)
## mu 0.008578 0.001189 7.2120 0.000000
## omega 0.000158 0.000048 3.3178 0.000907
## alpha1 0.029066 0.027553 1.0549 0.291471
## beta1 0.805477 0.038755 20.7837 0.000000
## gamma1 0.177144 0.052480 3.3755 0.000737
## shape 7.053718 1.266063 5.5714 0.000000
##
## Robust Standard Errors:
## Estimate Std. Error t value Pr(>|t|)
## mu 0.008578 0.001383 6.2034 0.000000
## omega 0.000158 0.000057 2.7662 0.005672
## alpha1 0.029066 0.026980 1.0773 0.281346
## beta1 0.805477 0.043424 18.5490 0.000000
## gamma1 0.177144 0.059237 2.9904 0.002786
## shape 7.053718 1.609965 4.3813 0.000012
##
## LogLikelihood : 1987.522
##
## Information Criteria
## ------------------------------------
##
## Akaike -3.3528
## Bayes -3.3271
## Shibata -3.3529
## Hannan-Quinn -3.3431
##
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 1.806 0.1790
## Lag[2*(p+q)+(p+q)-1][2] 1.808 0.2967
## Lag[4*(p+q)+(p+q)-1][5] 3.392 0.3401
## d.o.f=0
## H0 : No serial correlation
##
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 0.4889 0.4844
## Lag[2*(p+q)+(p+q)-1][5] 1.5225 0.7344
## Lag[4*(p+q)+(p+q)-1][9] 2.3204 0.8635
## d.o.f=2
##
## Weighted ARCH LM Tests
## ------------------------------------
## Statistic Shape Scale P-Value
## ARCH Lag[3] 0.1342 0.500 2.000 0.7141
## ARCH Lag[5] 0.6541 1.440 1.667 0.8374
## ARCH Lag[7] 1.1229 2.315 1.543 0.8928
##
## Nyblom stability test
## ------------------------------------
## Joint Statistic: 2.0092
## Individual Statistics:
## mu 0.40937
## omega 0.58842
## alpha1 0.88633
## beta1 0.76279
## gamma1 0.37973
## shape 0.07663
##
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic: 1.49 1.68 2.12
## Individual Statistic: 0.35 0.47 0.75
##
## Sign Bias Test
## ------------------------------------
## t-value prob sig
## Sign Bias 3.270 0.0011074 ***
## Negative Sign Bias 1.429 0.1532140
## Positive Sign Bias 0.349 0.7271654
## Joint Effect 17.117 0.0006686 ***
##
##
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
## group statistic p-value(g-1)
## 1 20 47.71 2.822e-04
## 2 30 62.37 3.109e-04
## 3 40 59.22 1.994e-02
## 4 50 99.30 2.859e-05
##
##
## Elapsed time : 0.468781
El modelo capta asimetría: las malas noticias generan más volatilidad que las buenas (γ > 0 y significativa). Todos los p-valores > 0.17 → No hay autocorrelación ni en la media ni en la varianza. p-valores > 0.71 → No hay efectos ARCH residuales. La heterocedasticidad fue bien capturada. El modelo está bien especificado en cuanto a dependencia temporal. Joint Statistic = 2.0092, supera los valores críticos al 1%, lo que sugiere una ligera inestabilidad en parámetros. Sign Bias: significativo (p ≈ 0.001), Joint Effect: muy significativo (p ≈ 0.0006), aunque el modelo GJR-GARCH incorpora asimetría, todavía hay evidencia de efectos asimétricos residuales no totalmente explicados. El modelo GJR-GARCH(1,1) con t-student capta la asimetría de choques negativos y refleja bien la leptocurtosis. En términos generales, es un modelo adecuado para capturar los principales patrones de la serie.