Universidade Federal de São Carlos
Departamento de Economia
Econometria Financeira
Análise de séries temporais financeiras usando R
Orientadora: Profa Dra. Andreza A. Palma
Monitor: Alex Albuquerque Rodrigues
Estudante:. Givanildo de Sousa Gramacho

Modelagem das ações da VALE: uma abordagem ARMA-GARCH

Seguindo o roteiro visto em aula, ajuste modelos GARCH(1,1), EGARCH(1,1) e GJR(1,1) para as ações da VALE, usando as distribuições t-Student e Normal.

Verifique qual é o melhor modelo dentre esses, verificando também os resíduos.

Apresente previsões para a volatilidade condicional.

library(BatchGetSymbols) ### pegar dados yahoo finance (preços diárias ativos negociados em bolsa)
## Warning: package 'BatchGetSymbols' was built under R version 4.3.1
## Carregando pacotes exigidos: rvest
## Carregando pacotes exigidos: dplyr
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
## 
library(rugarch)
## Warning: package 'rugarch' was built under R version 4.3.1
## Carregando pacotes exigidos: parallel
## 
## Attaching package: 'rugarch'
## The following object is masked from 'package:stats':
## 
##     sigma
library(tidyverse)
## Warning: package 'tidyverse' was built under R version 4.3.1
## Warning: package 'ggplot2' was built under R version 4.3.1
## Warning: package 'readr' was built under R version 4.3.1
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ forcats   1.0.0     ✔ readr     2.1.4
## ✔ ggplot2   3.4.2     ✔ stringr   1.5.0
## ✔ lubridate 1.9.2     ✔ tibble    3.2.1
## ✔ purrr     1.0.1     ✔ tidyr     1.3.0
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter()         masks stats::filter()
## ✖ readr::guess_encoding() masks rvest::guess_encoding()
## ✖ dplyr::lag()            masks stats::lag()
## ✖ purrr::reduce()         masks rugarch::reduce()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(ggthemes) 
## Warning: package 'ggthemes' was built under R version 4.3.1
library(FinTS)
## Warning: package 'FinTS' was built under R version 4.3.1
## Carregando pacotes exigidos: zoo
## 
## Attaching package: 'zoo'
## 
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
library(WriteXLS)
library(xtable)
## Warning: package 'xtable' was built under R version 4.3.1
library(tbl2xts)
## Warning: package 'tbl2xts' was built under R version 4.3.1
library(forecast)
## Warning: package 'forecast' was built under R version 4.3.1
## Registered S3 method overwritten by 'quantmod':
##   method            from
##   as.zoo.data.frame zoo 
## 
## Attaching package: 'forecast'
## 
## The following object is masked from 'package:FinTS':
## 
##     Acf
library(tseries)
## Warning: package 'tseries' was built under R version 4.3.1
library(timeSeries)
## Warning: package 'timeSeries' was built under R version 4.3.1
## Carregando pacotes exigidos: timeDate
## 
## Attaching package: 'timeDate'
## 
## The following object is masked from 'package:xtable':
## 
##     align
## 
## 
## Attaching package: 'timeSeries'
## 
## The following object is masked from 'package:zoo':
## 
##     time<-
library(lmtest)
## Warning: package 'lmtest' was built under R version 4.3.1
library(rugarch)
library(ggplot2)
library(cowplot)
## Warning: package 'cowplot' was built under R version 4.3.1
## 
## Attaching package: 'cowplot'
## 
## The following object is masked from 'package:ggthemes':
## 
##     theme_map
## 
## The following object is masked from 'package:lubridate':
## 
##     stamp
library(dplyr)
library(moments)
## 
## Attaching package: 'moments'
## 
## The following objects are masked from 'package:timeDate':
## 
##     kurtosis, skewness
#limpar o diretório
rm(list=ls())
# para pegar vários, podemos usar o argumento abaixo:
tickers = c('VALE3.SA')

#### Sys.time() é a última data disponível

assets <- BatchGetSymbols(tickers,
                          first.date = '2019-03-03',
                          last.date = Sys.time(),
                          type.return = "log",
                          freq.data = "daily")
## Warning: `BatchGetSymbols()` was deprecated in BatchGetSymbols 2.6.4.
## ℹ Please use `yfR::yf_get()` instead.
## ℹ 2022-05-01: Package BatchGetSymbols will soon be replaced by yfR.  More
##   details about the change is available at github
##   <<www.github.com/msperlin/yfR> You can install yfR by executing:
## 
## remotes::install_github('msperlin/yfR')
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## 
## Running BatchGetSymbols for:
##    tickers =VALE3.SA
##    Downloading data for benchmark ticker
## ^GSPC | yahoo (1|1) | Not Cached | Saving cache
## VALE3.SA | yahoo (1|1) | Not Cached | Saving cache - Got 96% of valid prices | OK!
vale3 <- assets[[2]]
#head(vale3)
# Eliminando os valores NA
vale3= na.omit(vale3)
head(vale3)
##   price.open price.high price.low price.close   volume price.adjusted
## 2      47.83      48.96     47.72       48.86 21112500       33.65979
## 3      48.26      48.89     47.65       48.85 25446000       33.65290
## 4      48.90      49.95     48.61       49.88 20201600       34.36247
## 5      49.80      50.33     49.55       49.97 15591300       34.42447
## 6      49.94      51.00     49.70       50.70 21999200       34.92736
## 7      50.80      50.93     50.20       50.71 17257400       34.93425
##     ref.date   ticker ret.adjusted.prices ret.closing.prices
## 2 2019-03-07 VALE3.SA        0.0167170108       0.0167169588
## 3 2019-03-08 VALE3.SA       -0.0002048101      -0.0002047311
## 4 2019-03-11 VALE3.SA        0.0208658022       0.0208657950
## 5 2019-03-12 VALE3.SA        0.0018027871       0.0018027076
## 6 2019-03-13 VALE3.SA        0.0145028705       0.0145030759
## 7 2019-03-14 VALE3.SA        0.0001972283       0.0001971861
daily_returns <- vale3 %>% 
  select(ref.date,ret.closing.prices)

date <- daily_returns %>%
  select(ref.date) %>% 
  rename(date = ref.date) %>% 
  slice(-1)

daily_returns <- daily_returns %>%
  select(ret.closing.prices) %>% 
  slice(-1)

## declarando como série temporal através do comando as.ts
daily_returns=as.ts(daily_returns)

Dados e análises descritivas.

# Fazer uma análise visual da série, verificando os fatos estilizados.
# Função para plotar os gráficos para qualquer ação que deseja analisar. 
plot_graficos <- function(acao) {
  
  # Gráfico 1: preços
  p <- ggplot(acao, aes(ref.date, price.close)) +
    geom_line(color='#006600') +
    labs(x = "", y = 'Preço Fechamento',
         title = paste("Cotação Diária da", acao$ticker[1]),
         subtitle = "Período: de 03/03/2019 a 11/08/2023",
         caption = "Fonte: B3") +
    theme_economist()

  # Gráfico 2: retornos diários
  daily_returns <- acao %>% select(ref.date, ticker, ret.closing.prices)
  plot_returns <- ggplot(daily_returns) +
    geom_line(aes(x = ref.date, y = ret.closing.prices), color='#006600') +
    labs(x = "", y = 'Retornos',
         title = paste("Retornos da", acao$ticker[1]),
         subtitle = "Período: de 03/03/2019 a 11/08/2023",
         caption = "Fonte: B3") +
    theme_economist()

  # Gráfico 3: Retornos absolutos (abs)
  plot_volatility <- ggplot(daily_returns) +
    geom_line(aes(x = ref.date, y = abs(ret.closing.prices)), color='#006600') +
    labs(x = "", y = 'Retornos absolutos',
         title = paste("Retornos abs da", acao$ticker[1]),
         subtitle = "Período: de 03/03/2019 a 11/08/2023",
         caption = "Fonte: B3") +
    theme_economist()

  # Gráfico 4: qqplot
  qqplot <- ggplot(daily_returns, aes(sample = ret.closing.prices)) +
    stat_qq() +
    stat_qq_line() +
    labs(x = "Teórico", y = 'Amostra',
         title = "QQplot",
         subtitle = paste("Retornos diários da", acao$ticker[1]),
         caption = "Fonte: Elaborado a partir de dados da B3") +
    theme_economist()

  # Gráfico 5: Histograma
  histogram <- ggplot(daily_returns) +
    geom_histogram(aes(x = ret.closing.prices, y = after_stat(density)),
                   color = "white", fill = "Dark grey", linetype = "solid", alpha = 0.8, binwidth = 0.02) +
    geom_density(aes(x = ret.closing.prices, y = after_stat(density)), color = "black") +
    labs(x = "", y = 'Densidade',
         title = "Histograma",
         subtitle = paste("Retornos diários da", acao$ticker[1]),
         caption = "Fonte: Elaborado a partir de dados da B3") +
    theme_economist()
    
  # Plotar os gráficos juntos
  plot_grid(plot_returns, qqplot, plot_volatility, histogram, nrow = 2)

}
# Gráfico 1: preços
p <- ggplot(vale3, aes(ref.date, price.close)) +
    geom_line(color='#006600') +
    labs(x = "", y = 'Preço Fechamento',
         title = paste("Cotação Diária da", vale3$ticker[1]),
         subtitle = "Período: de 03/03/2019 a 11/08/2023",
         caption = "Fonte: B3") +
    theme_economist()
p

plot_graficos(vale3)

# Calcular estatísticas descritivas para cada ação
estatisticas <- vale3 %>%
    group_by(ticker) %>%
    summarise(
      media = mean(ret.closing.prices),
      desvio_padrao = sd(ret.closing.prices),
      variancia = var(ret.closing.prices),
      curtose = kurtosis(ret.closing.prices),
      assimetria = skewness(ret.closing.prices)
    )
     # Adicionar coluna indicando se a distribuição é normal ou de cauda pesada
  estatisticas <- estatisticas %>%
    mutate(distribuicao = ifelse(curtose > 3, "Cauda Pesada", "Normal"))
    estatisticas
## # A tibble: 1 × 7
##   ticker      media desvio_padrao variancia curtose assimetria distribuicao
##   <chr>       <dbl>         <dbl>     <dbl>   <dbl>      <dbl> <chr>       
## 1 VALE3.SA 0.000216        0.0250  0.000624    11.3      0.298 Cauda Pesada
# Função para calcular os graus de liberdade da distribuição t-Student
df_t_student <- function(data) {
  n <- length(data)
  df <- ifelse(n < 30, n - 1, 30)
  return(df)
}

# Função para calcular estatísticas descritivas e plotar histograma
plot_estatisticas_histograma <- function(data, tickers) {
  # Plotar histograma
  grafico <- ggplot(data = data) +
    geom_histogram(aes(x = ret.closing.prices, y = after_stat(density)),
                   color = "black", fill = "white") +
    facet_wrap(~ticker, ncol = 2) +
    geom_density(aes(x = ret.closing.prices),
                 color = "blue", fill = "lightblue", alpha = 0.5) +
    stat_function(fun = dnorm,
                  args = list(mean = mean(data$ret.closing.prices), sd = sd(data$ret.closing.prices)),
                  color = "red", linetype = "dashed") +
    stat_function(fun = dt,
                  args = list(df = df_t_student(data$ret.closing.prices)),
                  color = "green", linetype = "dotted") +
    labs(x = "Retornos", y = "Densidade",
         title = "Distribuição Normal e t-Student",
         subtitle = "distribuicoes VALE3",
         caption = "Fonte: Dados da Acao") +
    theme_minimal()
  
  print(grafico)
}

# Chamar a função para ações desejadas
plot_estatisticas_histograma(vale3, ticker)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

tsdisplay(daily_returns, lag.max = 50)

# Calculando os retornos ao quadrado
returns_squared <- daily_returns^2

# Calculando a função de autocorrelação parcial (FACP) dos retornos ao quadrado
pacf_returns_squared <- pacf(returns_squared, lag.max = 50, plot = TRUE)

# Exibindo os resultados da FACP
pacf_returns_squared
## 
## Partial autocorrelations of series 'returns_squared', by lag
## 
##      1      2      3      4      5      6      7      8      9     10     11 
##  0.539  0.066  0.376 -0.033 -0.121 -0.092  0.051  0.168  0.083 -0.035 -0.015 
##     12     13     14     15     16     17     18     19     20     21     22 
## -0.052 -0.059  0.021 -0.005  0.072 -0.002 -0.017  0.012 -0.043 -0.023 -0.001 
##     23     24     25     26     27     28     29     30     31     32     33 
## -0.028  0.088 -0.015  0.000 -0.022  0.005  0.023 -0.007 -0.004  0.035 -0.018 
##     34     35     36     37     38     39     40     41     42     43     44 
##  0.017 -0.018 -0.001  0.007  0.009 -0.018  0.029 -0.035  0.017  0.011 -0.045 
##     45     46     47     48     49     50 
##  0.009 -0.011  0.017 -0.016  0.013 -0.026

Especificando os lags para o teste LM

lags = c(1,2,3,5,6,8,16)
# Testando efeito ARCH: Teste LM
for (lag in lags) {
  arch_test <- ArchTest(daily_returns, lags = lag, demean = TRUE)
  print(paste("Resultado do Teste LM (", lag, "lags):"))
  print(arch_test)
}
## [1] "Resultado do Teste LM ( 1 lags):"
## 
##  ARCH LM-test; Null hypothesis: no ARCH effects
## 
## data:  daily_returns
## Chi-squared = 323.27, df = 1, p-value < 2.2e-16
## 
## [1] "Resultado do Teste LM ( 2 lags):"
## 
##  ARCH LM-test; Null hypothesis: no ARCH effects
## 
## data:  daily_returns
## Chi-squared = 326.41, df = 2, p-value < 2.2e-16
## 
## [1] "Resultado do Teste LM ( 3 lags):"
## 
##  ARCH LM-test; Null hypothesis: no ARCH effects
## 
## data:  daily_returns
## Chi-squared = 436.02, df = 3, p-value < 2.2e-16
## 
## [1] "Resultado do Teste LM ( 5 lags):"
## 
##  ARCH LM-test; Null hypothesis: no ARCH effects
## 
## data:  daily_returns
## Chi-squared = 445.86, df = 5, p-value < 2.2e-16
## 
## [1] "Resultado do Teste LM ( 6 lags):"
## 
##  ARCH LM-test; Null hypothesis: no ARCH effects
## 
## data:  daily_returns
## Chi-squared = 450.89, df = 6, p-value < 2.2e-16
## 
## [1] "Resultado do Teste LM ( 8 lags):"
## 
##  ARCH LM-test; Null hypothesis: no ARCH effects
## 
## data:  daily_returns
## Chi-squared = 470.48, df = 8, p-value < 2.2e-16
## 
## [1] "Resultado do Teste LM ( 16 lags):"
## 
##  ARCH LM-test; Null hypothesis: no ARCH effects
## 
## data:  daily_returns
## Chi-squared = 479.64, df = 16, p-value < 2.2e-16

Configurar as ordens padrão para os modelos

# Configurar as ordens padrão para os modelos
orders <- c(1, 1)

# Configurações padrão para GARCH, EGARCH e GJR-GARCH com distribuição norm
garch_spec_norm <- ugarchspec(variance.model = list(model = "sGARCH", garchOrder = orders),
                               mean.model = list(armaOrder = c(0, 0), include.mean = FALSE),
                               distribution.model = "norm")

egarch_spec_norm <- ugarchspec(variance.model = list(model = "eGARCH", garchOrder = orders),
                                mean.model = list(armaOrder = c(0, 0), include.mean = FALSE),
                                distribution.model = "norm")

gjr_spec_norm <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = orders),
                             mean.model = list(armaOrder = c(0, 0), include.mean = FALSE),
                             distribution.model = "norm")

# Configurações padrão para GARCH, EGARCH e GJR-GARCH com distribuição std
garch_spec_std <- ugarchspec(variance.model = list(model = "sGARCH", garchOrder = orders),
                               mean.model = list(armaOrder = c(0, 0), include.mean = FALSE),
                               distribution.model = "std")

egarch_spec_std <- ugarchspec(variance.model = list(model = "eGARCH", garchOrder = orders),
                                mean.model = list(armaOrder = c(0, 0), include.mean = FALSE),
                                distribution.model = "std")

gjr_spec_std <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = orders),
                             mean.model = list(armaOrder = c(0, 0), include.mean = FALSE),
                             distribution.model = "std")

Ajustando o modelo GARCH(1,1), EGARCH(1,1), GJR(1,1) para distribuição normal e t-student.

# Ajustando o modelo GARCH(1,1) com distribuição Normal e t-student  aos retornos diários
garch_fit_norm <- ugarchfit(spec = garch_spec_norm, data = daily_returns[,1])
garch_fit_std <- ugarchfit(spec = garch_spec_std, data = daily_returns[,1])

# Ajustando o modelo EGARCH(1,1) com distribuição Normal e t-student  aos retornos diários
egarch_fit_norm <- ugarchfit(spec = egarch_spec_norm, data = daily_returns[,1])
egarch_fit_std <- ugarchfit(spec = egarch_spec_std, data = daily_returns[,1])

# Ajustando o modelo GJR(1,1) com distribuição Normal e t-student  aos retornos diários
gjr_fit_norm <- ugarchfit(spec = gjr_spec_norm, data = daily_returns[,1])
gjr_fit_std <- ugarchfit(spec = gjr_spec_std, data = daily_returns[,1])

Exibindo os resultados modelo GARCH(1,1), EGARCH(1,1), GJR(1,1) para distribuição normal e t-student.

# Exibindo os resultados GARCH(1,1) do ajuste com distribuição Normal e t-student 
print("Resultado do ajuste GARCH(1,1) com distribuição Normal:")
## [1] "Resultado do ajuste GARCH(1,1) com distribuição Normal:"
garch_fit_norm
## 
## *---------------------------------*
## *          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|)
## omega   0.000061    0.000020   3.1370 0.001707
## alpha1  0.119540    0.027300   4.3788 0.000012
## beta1   0.767551    0.055123  13.9244 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error  t value Pr(>|t|)
## omega   0.000061    0.000020   3.0493 0.002293
## alpha1  0.119540    0.045873   2.6059 0.009163
## beta1   0.767551    0.059724  12.8517 0.000000
## 
## LogLikelihood : 2631.778 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -4.7537
## Bayes        -4.7401
## Shibata      -4.7537
## Hannan-Quinn -4.7485
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                     0.1968  0.6573
## Lag[2*(p+q)+(p+q)-1][2]    0.4148  0.7350
## Lag[4*(p+q)+(p+q)-1][5]    1.1513  0.8246
## d.o.f=0
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                     0.8065  0.3691
## Lag[2*(p+q)+(p+q)-1][5]    3.3512  0.3466
## Lag[4*(p+q)+(p+q)-1][9]    4.9485  0.4370
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]    0.6886 0.500 2.000  0.4066
## ARCH Lag[5]    0.8256 1.440 1.667  0.7853
## ARCH Lag[7]    1.2010 2.315 1.543  0.8788
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  0.3914
## Individual Statistics:              
## omega  0.07219
## alpha1 0.11211
## beta1  0.06103
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          0.846 1.01 1.35
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                     t-value     prob sig
## Sign Bias           0.21569 0.829272    
## Negative Sign Bias  2.74845 0.006086 ***
## Positive Sign Bias  0.08747 0.930313    
## Joint Effect       10.10590 0.017687  **
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     41.78     0.001900
## 2    30     50.60     0.007776
## 3    40     61.16     0.013199
## 4    50     79.17     0.004079
## 
## 
## Elapsed time : 0.318609
# Exibindo os resultados do ajuste com distribuição t-Student
print("Resultado do ajuste GARCH(1,1) com distribuição t-Student:")
## [1] "Resultado do ajuste GARCH(1,1) com distribuição t-Student:"
garch_fit_std
## 
## *---------------------------------*
## *          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|)
## omega   0.000049    0.000020   2.4035 0.016240
## alpha1  0.093832    0.027995   3.3517 0.000803
## beta1   0.816838    0.056518  14.4528 0.000000
## shape   6.081206    1.119406   5.4325 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error  t value Pr(>|t|)
## omega   0.000049    0.000019   2.5383 0.011138
## alpha1  0.093832    0.040503   2.3166 0.020523
## beta1   0.816838    0.059473  13.7347 0.000000
## shape   6.081206    1.029334   5.9079 0.000000
## 
## LogLikelihood : 2656.329 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -4.7963
## Bayes        -4.7781
## Shibata      -4.7963
## Hannan-Quinn -4.7894
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                     0.2801  0.5967
## Lag[2*(p+q)+(p+q)-1][2]    0.5023  0.6925
## Lag[4*(p+q)+(p+q)-1][5]    1.2275  0.8064
## d.o.f=0
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                      2.397  0.1216
## Lag[2*(p+q)+(p+q)-1][5]     4.819  0.1681
## Lag[4*(p+q)+(p+q)-1][9]     6.722  0.2236
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]     1.776 0.500 2.000  0.1827
## ARCH Lag[5]     2.121 1.440 1.667  0.4451
## ARCH Lag[7]     2.537 2.315 1.543  0.6048
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  0.517
## Individual Statistics:              
## omega  0.12555
## alpha1 0.12410
## beta1  0.09135
## shape  0.14617
## 
## 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           0.4052 0.6854046    
## Negative Sign Bias  3.4431 0.0005966 ***
## Positive Sign Bias  0.4039 0.6863538    
## Joint Effect       14.6100 0.0021822 ***
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     17.47       0.5579
## 2    30     37.25       0.1398
## 3    40     38.59       0.4883
## 4    50     41.47       0.7690
## 
## 
## Elapsed time : 0.169718
# Exibindo os resultados EGARCH(1,1) do ajuste com distribuição Normal e t-student 
print("Resultado do ajuste EGARCH(1,1) com distribuição Normal:")
## [1] "Resultado do ajuste EGARCH(1,1) com distribuição Normal:"
egarch_fit_norm
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : eGARCH(1,1)
## Mean Model   : ARFIMA(0,0,0)
## Distribution : norm 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error  t value Pr(>|t|)
## omega  -0.625420    0.281461  -2.2220 0.026280
## alpha1 -0.099382    0.026797  -3.7087 0.000208
## beta1   0.916430    0.037184  24.6456 0.000000
## gamma1  0.204454    0.046242   4.4214 0.000010
## 
## Robust Standard Errors:
##         Estimate  Std. Error  t value Pr(>|t|)
## omega  -0.625420    0.450004  -1.3898 0.164586
## alpha1 -0.099382    0.039619  -2.5084 0.012128
## beta1   0.916430    0.059569  15.3843 0.000000
## gamma1  0.204454    0.083894   2.4371 0.014807
## 
## LogLikelihood : 2639.125 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -4.7651
## Bayes        -4.7470
## Shibata      -4.7652
## Hannan-Quinn -4.7583
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                     0.1080  0.7425
## Lag[2*(p+q)+(p+q)-1][2]    0.2261  0.8383
## Lag[4*(p+q)+(p+q)-1][5]    1.0214  0.8548
## d.o.f=0
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                      2.205  0.1376
## Lag[2*(p+q)+(p+q)-1][5]     5.434  0.1218
## Lag[4*(p+q)+(p+q)-1][9]     7.052  0.1949
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]     2.770 0.500 2.000 0.09606
## ARCH Lag[5]     3.130 1.440 1.667 0.27148
## ARCH Lag[7]     3.584 2.315 1.543 0.41054
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  0.7066
## Individual Statistics:              
## omega  0.10936
## alpha1 0.26934
## beta1  0.10610
## gamma1 0.08588
## 
## 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           0.6233 0.53320    
## Negative Sign Bias  2.5496 0.01092  **
## Positive Sign Bias  1.0791 0.28080    
## Joint Effect        7.7094 0.05242   *
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     38.38     0.005314
## 2    30     48.05     0.014521
## 3    40     60.37     0.015659
## 4    50     68.68     0.033142
## 
## 
## Elapsed time : 0.105809
# Exibindo os resultados EGARCH(1,1) do ajuste com distribuição t-Student
print("Resultado do ajuste EGARCH(1,1) com distribuição t-Student:")
## [1] "Resultado do ajuste EGARCH(1,1) com distribuição t-Student:"
egarch_fit_std
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : eGARCH(1,1)
## Mean Model   : ARFIMA(0,0,0)
## Distribution : std 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error  t value Pr(>|t|)
## omega  -0.457699    0.085984  -5.3231 0.000000
## alpha1 -0.087423    0.024094  -3.6285 0.000285
## beta1   0.939447    0.011225  83.6922 0.000000
## gamma1  0.169392    0.036155   4.6852 0.000003
## shape   6.249158    1.199525   5.2097 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error  t value Pr(>|t|)
## omega  -0.457699    0.080652  -5.6750 0.000000
## alpha1 -0.087423    0.027967  -3.1259 0.001773
## beta1   0.939447    0.010060  93.3865 0.000000
## gamma1  0.169392    0.062498   2.7104 0.006721
## shape   6.249158    1.094034   5.7120 0.000000
## 
## LogLikelihood : 2660.706 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -4.8024
## Bayes        -4.7797
## Shibata      -4.8024
## Hannan-Quinn -4.7938
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                     0.1664  0.6834
## Lag[2*(p+q)+(p+q)-1][2]    0.2946  0.7987
## Lag[4*(p+q)+(p+q)-1][5]    1.0953  0.8377
## d.o.f=0
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                      4.001 0.04546
## Lag[2*(p+q)+(p+q)-1][5]     7.646 0.03606
## Lag[4*(p+q)+(p+q)-1][9]     9.706 0.05794
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]     4.247 0.500 2.000 0.03932
## ARCH Lag[5]     5.032 1.440 1.667 0.10103
## ARCH Lag[7]     5.605 2.315 1.543 0.17009
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  0.876
## Individual Statistics:              
## omega  0.11513
## alpha1 0.28525
## beta1  0.11459
## gamma1 0.18476
## shape  0.08511
## 
## 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.7436 0.457248    
## Negative Sign Bias  3.1343 0.001768 ***
## Positive Sign Bias  1.2268 0.220173    
## Joint Effect       11.4578 0.009491 ***
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     18.99       0.4574
## 2    30     30.20       0.4039
## 3    40     37.80       0.5246
## 4    50     36.59       0.9049
## 
## 
## Elapsed time : 0.207397
# Exibindo os resultados GJR(1,1) do ajuste com distribuição Normal e t-student 
print("Resultado do ajuste GJR(1,1) com distribuição Normal:")
## [1] "Resultado do ajuste GJR(1,1) com distribuição Normal:"
gjr_fit_norm
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(1,1)
## Mean Model   : ARFIMA(0,0,0)
## Distribution : norm 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error  t value Pr(>|t|)
## omega   0.000052    0.000017   3.1085 0.001881
## alpha1  0.030092    0.021468   1.4017 0.161000
## beta1   0.801463    0.049689  16.1297 0.000000
## gamma1  0.152219    0.041915   3.6316 0.000282
## 
## Robust Standard Errors:
##         Estimate  Std. Error  t value Pr(>|t|)
## omega   0.000052    0.000021   2.5101 0.012070
## alpha1  0.030092    0.027669   1.0876 0.276774
## beta1   0.801463    0.064279  12.4685 0.000000
## gamma1  0.152219    0.061437   2.4777 0.013225
## 
## LogLikelihood : 2640.967 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -4.7685
## Bayes        -4.7504
## Shibata      -4.7685
## Hannan-Quinn -4.7616
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                    0.06897  0.7928
## Lag[2*(p+q)+(p+q)-1][2]   0.28107  0.8063
## Lag[4*(p+q)+(p+q)-1][5]   1.05412  0.8473
## d.o.f=0
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                     0.4951  0.4816
## Lag[2*(p+q)+(p+q)-1][5]    3.2492  0.3634
## Lag[4*(p+q)+(p+q)-1][9]    4.4022  0.5221
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]    0.4389 0.500 2.000  0.5077
## ARCH Lag[5]    0.5636 1.440 1.667  0.8647
## ARCH Lag[7]    0.8894 2.315 1.543  0.9309
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  0.5788
## Individual Statistics:              
## omega  0.08956
## alpha1 0.08552
## beta1  0.06930
## gamma1 0.15315
## 
## 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          0.0005076 0.9996    
## Negative Sign Bias 1.5740641 0.1158    
## Positive Sign Bias 0.9478807 0.3434    
## Joint Effect       3.6064555 0.3072    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     39.75     0.003528
## 2    30     46.97     0.018767
## 3    40     58.70     0.022193
## 4    50     63.89     0.074919
## 
## 
## Elapsed time : 0.249527
# Exibindo os resultados EGARCH(1,1) do ajuste com distribuição t-Student
print("Resultado do ajuste GJR(1,1) com distribuição t-Student:")
## [1] "Resultado do ajuste GJR(1,1) com distribuição t-Student:"
gjr_fit_std
## 
## *---------------------------------*
## *          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|)
## omega   0.000044    0.000018   2.4485 0.014346
## alpha1  0.024837    0.022510   1.1034 0.269861
## beta1   0.833759    0.052266  15.9522 0.000000
## gamma1  0.129588    0.046128   2.8093 0.004965
## shape   6.491127    1.263675   5.1367 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error  t value Pr(>|t|)
## omega   0.000044    0.000020   2.2154 0.026731
## alpha1  0.024837    0.024523   1.0128 0.311160
## beta1   0.833759    0.062840  13.2679 0.000000
## gamma1  0.129588    0.059553   2.1760 0.029554
## shape   6.491127    1.132248   5.7330 0.000000
## 
## LogLikelihood : 2662.127 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -4.8049
## Bayes        -4.7823
## Shibata      -4.8050
## Hannan-Quinn -4.7964
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                     0.1047  0.7462
## Lag[2*(p+q)+(p+q)-1][2]    0.3305  0.7790
## Lag[4*(p+q)+(p+q)-1][5]    1.1031  0.8359
## d.o.f=0
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                     0.9673  0.3254
## Lag[2*(p+q)+(p+q)-1][5]    3.4482  0.3313
## Lag[4*(p+q)+(p+q)-1][9]    4.7092  0.4733
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]    0.8644 0.500 2.000  0.3525
## ARCH Lag[5]    1.0885 1.440 1.667  0.7068
## ARCH Lag[7]    1.4433 2.315 1.543  0.8327
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  0.6406
## Individual Statistics:             
## omega  0.1343
## alpha1 0.1320
## beta1  0.1009
## gamma1 0.1950
## shape  0.1361
## 
## 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.08094 0.93550    
## Negative Sign Bias 2.02926 0.04267  **
## Positive Sign Bias 1.05273 0.29269    
## Joint Effect       5.60912 0.13226    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     22.54       0.2584
## 2    30     33.51       0.2576
## 3    40     46.19       0.1996
## 4    50     44.54       0.6542
## 
## 
## Elapsed time : 0.3875811

Calculando os critérios de informação

# Calculando os critérios de informação BIC 
bics <- c(infocriteria(garch_fit_norm)[2], infocriteria(garch_fit_std)[2],
          infocriteria(egarch_fit_norm)[2], infocriteria(egarch_fit_std)[2],
          infocriteria(gjr_fit_norm)[2], infocriteria(gjr_fit_std)[2])

# Criando a tabela de resultados
results_table <- data.frame(Model = c("sGARCH Normal", "sGARCH t-Student",
                                      "eGARCH Normal", "eGARCH t-Student",
                                      "GJR-GARCH Normal", "GJR-GARCH t-Student"),
                             Bayes = bics)

# Ordenando a tabela pelo valor do BIC
results_table <- results_table[order(results_table$Bayes), ]

# Exibindo a tabela de resultados
print("Tabela de Resultados:")
## [1] "Tabela de Resultados:"
print(results_table)
##                 Model     Bayes
## 6 GJR-GARCH t-Student -4.782290
## 4    eGARCH t-Student -4.779720
## 2    sGARCH t-Student -4.778142
## 5    GJR-GARCH Normal -4.750362
## 3       eGARCH Normal -4.747030
## 1       sGARCH Normal -4.740082
Seleção das configurações do modelos VALE3
Especificações Amostra completa usando (BIC)
GJR-GARCH t-Student -4.782290
eGARCH t-Student -4.779720
sGARCH t-Student -4.778142
GJR-GARCH Normal -4.750362
eGARCH Normal -4.747030
sGARCH Normal -4.740082

Podemos analisar pelos critérios informações BIC os melhores modelos são GJR-GARCH t-Student, eGARCH t-Student, sGARCH t-Student por se tratar de um modelo t-student observado anteriormente com fatos estilizados, escolheremos o modelos GJR-GARCH t-Student e eGARCH t-Student

Parametros dos modelo escolhido GJR-GARCH t-Student e eGARCH t-Student para VALE3.SA

# Exibindo a tabela de coeficientes em formato LaTeX
Table <- xtable(gjr_fit_std@fit$matcoef)
# print(Table, type = "latex", comment = FALSE)
#Table
gjr_fit_std@fit$matcoef
##            Estimate   Std. Error   t value     Pr(>|t|)
## omega  4.402175e-05 1.797923e-05  2.448478 1.434613e-02
## alpha1 2.483690e-02 2.250976e-02  1.103384 2.698606e-01
## beta1  8.337588e-01 5.226596e-02 15.952235 0.000000e+00
## gamma1 1.295883e-01 4.612847e-02  2.809292 4.965060e-03
## shape  6.491127e+00 1.263675e+00  5.136706 2.795963e-07
# Exibindo a tabela de coeficientes em formato LaTeX
Table <- xtable(egarch_fit_std@fit$matcoef)
# print(Table, type = "latex", comment = FALSE)
#Table
egarch_fit_std@fit$matcoef
##           Estimate  Std. Error   t value     Pr(>|t|)
## omega  -0.45769858  0.08598381 -5.323079 1.020257e-07
## alpha1 -0.08742331  0.02409360 -3.628487 2.850868e-04
## beta1   0.93944671  0.01122502 83.692178 0.000000e+00
## gamma1  0.16939209  0.03615485  4.685183 2.797100e-06
## shape   6.24915808  1.19952507  5.209694 1.891528e-07

Calculando e plotando a volatilidade condicional estimada

sigma <- sigma(gjr_fit_std) %>% xts_tbl() 
colnames(sigma) <- c("date", "sigma") 
sigma <- sigma %>% mutate(date = as.Date(date))

# Plotando a volatilidade condicional estimada
ggplot(sigma) + geom_line(aes(x = date , y = sigma)) + theme_solarized()

Calculando o parâmetro de persistência escolhido da ação VALE3 para periodo completo, dos melhores modelos eGARCH(1,1)-std vs GJR-GARCH(1,1)-std

# Calculando o parâmetro de persistência escolhido para periodo completo 

print("Parâmetro de Persistência EGARCH(1,1) t-student:")
## [1] "Parâmetro de Persistência EGARCH(1,1) t-student:"
print(persistence(egarch_fit_std))
## [1] 0.9394467
print("Parâmetro de Persistência GJRGARCH(1,1) t-student:")
## [1] "Parâmetro de Persistência GJRGARCH(1,1) t-student:"
print(persistence(gjr_fit_std))
## [1] 0.9233899
# Calculando a persistência para cada modelo
persist_egarch <- persistence(egarch_fit_std)
persist_gjr <- persistence(gjr_fit_std)

# Calculando o half-life para cada modelo
half_life_egarch <- -log(2) / log(persist_egarch)
half_life_gjr <- -log(2) / log(persist_gjr)

# Criando a tabela com os resultados
results_table <- data.frame(Model = c("eGARCH(1,1) t-student", "GJRGARCH(1,1) t-student"),
                             Persistência = c(persist_egarch, persist_gjr),
                             Half_Life = c(half_life_egarch, half_life_gjr))

print("Tabela de Resultados Persistência e Half life:")
## [1] "Tabela de Resultados Persistência e Half life:"
print(results_table)
##                     Model Persistência Half_Life
## 1   eGARCH(1,1) t-student    0.9394467  11.09671
## 2 GJRGARCH(1,1) t-student    0.9233899   8.69655

Verificar os resíduos

plot(egarch_fit_std, which=11)

acf(residuals(egarch_fit_std))

pacf(residuals(egarch_fit_std))

Realizando previsões usando o modelo ajustado eGARCH(1,1) t-student

# Realizando previsões usando o modelo ajustado
n_ahead <- 10
egarch_std_forecast <- ugarchforecast(egarch_fit_std, n.ahead = n_ahead)
print(paste("Previsão da Volatilidade para", n_ahead, "passos à frente:"))
## [1] "Previsão da Volatilidade para 10 passos à frente:"
print(egarch_std_forecast)
## 
## *------------------------------------*
## *       GARCH Model Forecast         *
## *------------------------------------*
## Model: eGARCH
## Horizon: 10
## Roll Steps: 0
## Out of Sample: 0
## 
## 0-roll forecast [T0=1106-01-01]:
##      Series   Sigma
## T+1       0 0.02532
## T+2       0 0.02516
## T+3       0 0.02501
## T+4       0 0.02488
## T+5       0 0.02475
## T+6       0 0.02463
## T+7       0 0.02452
## T+8       0 0.02441
## T+9       0 0.02431
## T+10      0 0.02422
# Plotando previsões da volatilidade
p1 <- plot(egarch_fit_std, which = 1)

p1
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : eGARCH(1,1)
## Mean Model   : ARFIMA(0,0,0)
## Distribution : std 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error  t value Pr(>|t|)
## omega  -0.457699    0.085984  -5.3231 0.000000
## alpha1 -0.087423    0.024094  -3.6285 0.000285
## beta1   0.939447    0.011225  83.6922 0.000000
## gamma1  0.169392    0.036155   4.6852 0.000003
## shape   6.249158    1.199525   5.2097 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error  t value Pr(>|t|)
## omega  -0.457699    0.080652  -5.6750 0.000000
## alpha1 -0.087423    0.027967  -3.1259 0.001773
## beta1   0.939447    0.010060  93.3865 0.000000
## gamma1  0.169392    0.062498   2.7104 0.006721
## shape   6.249158    1.094034   5.7120 0.000000
## 
## LogLikelihood : 2660.706 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -4.8024
## Bayes        -4.7797
## Shibata      -4.8024
## Hannan-Quinn -4.7938
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                     0.1664  0.6834
## Lag[2*(p+q)+(p+q)-1][2]    0.2946  0.7987
## Lag[4*(p+q)+(p+q)-1][5]    1.0953  0.8377
## d.o.f=0
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                      4.001 0.04546
## Lag[2*(p+q)+(p+q)-1][5]     7.646 0.03606
## Lag[4*(p+q)+(p+q)-1][9]     9.706 0.05794
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]     4.247 0.500 2.000 0.03932
## ARCH Lag[5]     5.032 1.440 1.667 0.10103
## ARCH Lag[7]     5.605 2.315 1.543 0.17009
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  0.876
## Individual Statistics:              
## omega  0.11513
## alpha1 0.28525
## beta1  0.11459
## gamma1 0.18476
## shape  0.08511
## 
## 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.7436 0.457248    
## Negative Sign Bias  3.1343 0.001768 ***
## Positive Sign Bias  1.2268 0.220173    
## Joint Effect       11.4578 0.009491 ***
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     18.99       0.4574
## 2    30     30.20       0.4039
## 3    40     37.80       0.5246
## 4    50     36.59       0.9049
## 
## 
## Elapsed time : 0.207397
p2 <- plot(egarch_fit_std, which = 3)

p2
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : eGARCH(1,1)
## Mean Model   : ARFIMA(0,0,0)
## Distribution : std 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error  t value Pr(>|t|)
## omega  -0.457699    0.085984  -5.3231 0.000000
## alpha1 -0.087423    0.024094  -3.6285 0.000285
## beta1   0.939447    0.011225  83.6922 0.000000
## gamma1  0.169392    0.036155   4.6852 0.000003
## shape   6.249158    1.199525   5.2097 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error  t value Pr(>|t|)
## omega  -0.457699    0.080652  -5.6750 0.000000
## alpha1 -0.087423    0.027967  -3.1259 0.001773
## beta1   0.939447    0.010060  93.3865 0.000000
## gamma1  0.169392    0.062498   2.7104 0.006721
## shape   6.249158    1.094034   5.7120 0.000000
## 
## LogLikelihood : 2660.706 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -4.8024
## Bayes        -4.7797
## Shibata      -4.8024
## Hannan-Quinn -4.7938
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                     0.1664  0.6834
## Lag[2*(p+q)+(p+q)-1][2]    0.2946  0.7987
## Lag[4*(p+q)+(p+q)-1][5]    1.0953  0.8377
## d.o.f=0
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                      4.001 0.04546
## Lag[2*(p+q)+(p+q)-1][5]     7.646 0.03606
## Lag[4*(p+q)+(p+q)-1][9]     9.706 0.05794
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]     4.247 0.500 2.000 0.03932
## ARCH Lag[5]     5.032 1.440 1.667 0.10103
## ARCH Lag[7]     5.605 2.315 1.543 0.17009
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  0.876
## Individual Statistics:              
## omega  0.11513
## alpha1 0.28525
## beta1  0.11459
## gamma1 0.18476
## shape  0.08511
## 
## 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.7436 0.457248    
## Negative Sign Bias  3.1343 0.001768 ***
## Positive Sign Bias  1.2268 0.220173    
## Joint Effect       11.4578 0.009491 ***
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     18.99       0.4574
## 2    30     30.20       0.4039
## 3    40     37.80       0.5246
## 4    50     36.59       0.9049
## 
## 
## Elapsed time : 0.207397

Conclusão:

VALE3.SA
Model Persistência Half_Life
eGARCH(1,1) t-student 0.9394467 11.09
GJRGARCH(1,1) t-student 0.9233899 8.69

Comparando a tabela acima para modelo a um aumento de 0.923 para 0.939 na persistência dos choques os choques serão mais lentamente enfraquecidos ao longo do tempo. O cálculo da half-life mostra que no periodo inteiro conforme pedido no exercício da ação VALE3 modelo GJRGARCH-std 8.69 dias para dissipação de um choque e para o modelo eGARCH(1,1) t-student seria necessarios 11.09 dias para dissipação do choque de volatilidade.