#¿Qué es un modelo VAR? un modelo VAR es un modelo estadístico que se utiliza para analizar cómo varias variables económicas interactúan entre sí a lo largo del tiempo. Es especialmente útil cuando se desea analizar el efecto de una variable sobre otras variables en el sistema y cómo estas interacciones se propagan en el tiempo. #¿Qué parámetros utiliza un modelo VAR? Coeficientes de retardo: estos son los coeficientes que describen cómo las variables dependen de sus valores pasados y de los valores pasados de las otras variables en el sistema. En un modelo VAR, se especifica una ecuación para cada variable en el sistema, y cada ecuación incluye coeficientes de retardo para esa variable y para las demás variables del sistema.

Matriz de covarianza residual: esta matriz describe la relación entre los errores de las diferentes ecuaciones en el modelo. Los errores son las diferencias entre los valores observados de las variables y los valores predichos por el modelo.

Términos de error: estos términos representan el ruido aleatorio en el sistema, es decir, los factores impredecibles que afectan a las variables en el sistema y que no se explican por los coeficientes de retardo y la matriz de covarianza residual.

#¿Para qué sirve un modelo VAR? Un modelo VAR (Vector Autoregression) es una técnica estadística utilizada para analizar la relación entre múltiples variables que evolucionan con el tiempo. En particular, un modelo VAR es útil para modelar series de tiempo de varias variables que interactúan entre sí y se afectan mutuamente en el corto y largo plazo.

#¿Qué es un modelo SVAR? Un modelo SVAR (Structural Vector Autoregression) es una técnica estadística que se utiliza para modelar la relación entre múltiples variables que evolucionan con el tiempo, como en el modelo VAR. Sin embargo, a diferencia del modelo VAR, un modelo SVAR introduce restricciones estructurales en las relaciones entre las variables.

#¿Para qué sirve realizar un modelo SVAR? el modelo SVAR es una herramienta útil para analizar las relaciones entre múltiples variables que evolucionan con el tiempo y hacer predicciones sobre su comportamiento futuro. Su capacidad para identificar relaciones causales y evaluar el impacto de las políticas económicas lo hacen particularmente valioso en el análisis económico y financiero.

#¿Qué información podemos obtener de la distribución de la varianza? la distribución de la varianza proporciona información valiosa sobre la variabilidad de los datos y puede ser utilizada para evaluar la normalidad de los datos, identificar valores atípicos, evaluar la eficacia de los modelos y tomar decisiones informadas sobre la gestión de la variabilidad en los datos.

#Parte práctica

library(urca)
library(vars)
## Warning: package 'vars' was built under R version 4.2.3
## Loading required package: MASS
## Loading required package: strucchange
## Loading required package: zoo
## 
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
## Loading required package: sandwich
## Loading required package: lmtest
library(mFilter)
## Warning: package 'mFilter' was built under R version 4.2.3
library(tseries)
## Registered S3 method overwritten by 'quantmod':
##   method            from
##   as.zoo.data.frame zoo
library(TSstudio)
## Warning: package 'TSstudio' was built under R version 4.2.3
library(forecast)
library(tidyverse)
## Warning: package 'tibble' was built under R version 4.2.3
## Warning: package 'dplyr' was built under R version 4.2.3
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.1     ✔ readr     2.1.4
## ✔ forcats   1.0.0     ✔ stringr   1.5.0
## ✔ ggplot2   3.4.1     ✔ tibble    3.2.1
## ✔ lubridate 1.9.2     ✔ tidyr     1.3.0
## ✔ purrr     1.0.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ stringr::boundary() masks strucchange::boundary()
## ✖ dplyr::filter()     masks stats::filter()
## ✖ dplyr::lag()        masks stats::lag()
## ✖ dplyr::select()     masks MASS::select()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(fpp2)
## ── Attaching packages ────────────────────────────────────────────── fpp2 2.5 ──
## ✔ fma       2.5     ✔ expsmooth 2.3
series<-uschange
autoplot(uschange[,2:4])

#Series de tiempo

Serie_de_tiempo_1 <- ts((uschange[,2]), start = c(2008,3,1), frequency = 60)
Serie_de_tiempo_2 <- ts((uschange[,4]), start = c(2008,3,1), frequency = 60)
Serie_de_tiempo_3 <- ts((uschange[,3]), start = c(2008,3,1), frequency = 60)

#Creacion del modelo

sv <- cbind(Serie_de_tiempo_1, Serie_de_tiempo_2, Serie_de_tiempo_3)
colnames(sv) <- cbind( "Ingreso", "Ahorros", "Produccion")
lagselect <- VARselect(sv, lag.max = 8, type = "both")
lagselect$selection
## AIC(n)  HQ(n)  SC(n) FPE(n) 
##      5      1      1      5
lagselect$criteria
##                1         2         3         4         5         6         7
## AIC(n)  4.447859  4.412185  4.399696  4.391840  4.372070  4.436718  4.444030
## HQ(n)   4.556165  4.585475  4.637971  4.695099  4.740313  4.869945  4.942241
## SC(n)   4.714958  4.839544  4.987315  5.139719  5.280208  5.505116  5.672687
## FPE(n) 85.447512 82.464124 81.464016 80.866590 79.343987 84.735019 85.482822
##                8
## AIC(n)  4.499097
## HQ(n)   5.062291
## SC(n)   5.888013
## FPE(n) 90.495886
Modelo01 <- VAR(sv, p = 5, season = NULL, exog = NULL, type = "const")
Modelo02 <- VAR(sv, p = 1, season = NULL, exog = NULL, type = "const")


Ingresos <-causality(Modelo02, cause = 'Ingreso')
Ingresos
## $Granger
## 
##  Granger causality H0: Ingreso do not Granger-cause Ahorros Produccion
## 
## data:  VAR object Modelo02
## F-Test = 6.4395, df1 = 2, df2 = 546, p-value = 0.001721
## 
## 
## $Instant
## 
##  H0: No instantaneous causality between: Ingreso and Ahorros Produccion
## 
## data:  VAR object Modelo02
## Chi-squared = 70.334, df = 2, p-value = 5.551e-16
Ahorros <-causality(Modelo02, cause = 'Ahorros')
Ahorros
## $Granger
## 
##  Granger causality H0: Ahorros do not Granger-cause Ingreso Produccion
## 
## data:  VAR object Modelo02
## F-Test = 10.277, df1 = 2, df2 = 546, p-value = 4.154e-05
## 
## 
## $Instant
## 
##  H0: No instantaneous causality between: Ahorros and Ingreso Produccion
## 
## data:  VAR object Modelo02
## Chi-squared = 67.877, df = 2, p-value = 1.776e-15
Producción <-causality(Modelo02, cause = 'Produccion')
Producción
## $Granger
## 
##  Granger causality H0: Produccion do not Granger-cause Ingreso Ahorros
## 
## data:  VAR object Modelo02
## F-Test = 0.22697, df1 = 2, df2 = 546, p-value = 0.797
## 
## 
## $Instant
## 
##  H0: No instantaneous causality between: Produccion and Ingreso Ahorros
## 
## data:  VAR object Modelo02
## Chi-squared = 31.548, df = 2, p-value = 1.411e-07

#Restricciones

amat <- diag(3)
amat[2,1] <- NA
amat[3,1] <- NA
amat[3,2] <- NA
amat
##      [,1] [,2] [,3]
## [1,]    1    0    0
## [2,]   NA    1    0
## [3,]   NA   NA    1
SVARModelo01 <- SVAR(Modelo02, Amat = amat, Bmat = NULL, hessian = TRUE, estmethod =
                   c("scoring", "direct"))
## Warning in SVAR(Modelo02, Amat = amat, Bmat = NULL, hessian = TRUE, estmethod =
## c("scoring", : Convergence not achieved after 100 iterations. Convergence value:
## 1 .
SVARModelo01
## 
## SVAR Estimation Results:
## ======================== 
## 
## 
## Estimated A matrix:
##             Ingreso  Ahorros Produccion
## Ingreso      1.0000  0.00000          0
## Ahorros    -10.2416  1.00000          0
## Produccion  -0.2293 -0.01285          1

#Impulso

SVARog <- irf(SVARModelo01, impulse = "Ingreso", response = "Ingreso", n.ahead = 12)
## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .
SVARog
## 
## Impulse response coefficients
## $Ingreso
##             Ingreso
##  [1,]  1.000000e+00
##  [2,] -1.016788e-01
##  [3,]  9.464192e-02
##  [4,] -1.522303e-02
##  [5,]  8.784582e-03
##  [6,] -2.163096e-03
##  [7,]  7.457055e-04
##  [8,] -3.182013e-04
##  [9,]  4.319715e-05
## [10,] -5.145393e-05
## [11,] -3.375862e-06
## [12,] -9.397457e-06
## [13,] -2.218809e-06
## 
## 
## Lower Band, CI= 0.95 
## $Ingreso
##             Ingreso
##  [1,]  1.000000e+00
##  [2,] -2.152019e-01
##  [3,]  2.437963e-02
##  [4,] -5.224269e-02
##  [5,] -4.869332e-03
##  [6,] -1.308752e-02
##  [7,] -2.126448e-03
##  [8,] -2.762031e-03
##  [9,] -5.839312e-04
## [10,] -5.316186e-04
## [11,] -1.688141e-04
## [12,] -1.079924e-04
## [13,] -3.844466e-05
## 
## 
## Upper Band, CI= 0.95 
## $Ingreso
##            Ingreso
##  [1,] 1.0000000000
##  [2,] 0.0289615101
##  [3,] 0.1638835103
##  [4,] 0.0096459644
##  [5,] 0.0275128174
##  [6,] 0.0058149336
##  [7,] 0.0058239112
##  [8,] 0.0024794602
##  [9,] 0.0017583593
## [10,] 0.0009283991
## [11,] 0.0006184048
## [12,] 0.0003544367
## [13,] 0.0002307718
plot(SVARog)

SVARinf <- irf(SVARModelo01, impulse = "Ingreso", response = "Ahorros", n.ahead = 12)
## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .
SVARinf
## 
## Impulse response coefficients
## $Ingreso
##             Ahorros
##  [1,] 10.2415760698
##  [2,] -4.3425225785
##  [3,]  0.9990046275
##  [4,] -0.5234141811
##  [5,]  0.0804970547
##  [6,] -0.0700906269
##  [7,]  0.0019917219
##  [8,] -0.0108616506
##  [9,] -0.0014016601
## [10,] -0.0019652739
## [11,] -0.0005396384
## [12,] -0.0004023584
## [13,] -0.0001513814
## 
## 
## Lower Band, CI= 0.95 
## $Ingreso
##            Ahorros
##  [1,]  7.524690583
##  [2,] -6.386487067
##  [3,] -0.016039830
##  [4,] -1.145065404
##  [5,] -0.153385975
##  [6,] -0.252721661
##  [7,] -0.072568062
##  [8,] -0.071055354
##  [9,] -0.031877425
## [10,] -0.023128896
## [11,] -0.012165608
## [12,] -0.008864248
## [13,] -0.004732889
## 
## 
## Upper Band, CI= 0.95 
## $Ingreso
##             Ahorros
##  [1,] 12.0570864720
##  [2,] -2.2260676698
##  [3,]  2.0149940319
##  [4,] -0.1302450253
##  [5,]  0.3592840400
##  [6,]  0.0198841553
##  [7,]  0.0624764533
##  [8,]  0.0063438009
##  [9,]  0.0114217563
## [10,]  0.0013013396
## [11,]  0.0022296260
## [12,]  0.0003744725
## [13,]  0.0004227858
plot(SVARinf)

SVARrrp <- irf(SVARModelo01, impulse = "Ingreso", response = "Produccion", n.ahead = 12)
## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .
## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat =
## amat, : Convergence not achieved after 100 iterations. Convergence value:
## 0.568194157562837 .
## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .
SVARrrp
## 
## Impulse response coefficients
## $Ingreso
##         Produccion
##  [1,] 0.3609393520
##  [2,] 0.3348706261
##  [3,] 0.2592046907
##  [4,] 0.1372317970
##  [5,] 0.0755596802
##  [6,] 0.0375658766
##  [7,] 0.0191416104
##  [8,] 0.0093893700
##  [9,] 0.0046652610
## [10,] 0.0022823289
## [11,] 0.0011237024
## [12,] 0.0005496393
## [13,] 0.0002696749
## 
## 
## Lower Band, CI= 0.95 
## $Ingreso
##          Produccion
##  [1,]  0.1611466095
##  [2,]  0.1153873221
##  [3,]  0.1264018653
##  [4,]  0.0368546595
##  [5,]  0.0152916216
##  [6,]  0.0010039432
##  [7,] -0.0015604429
##  [8,] -0.0015504138
##  [9,] -0.0016673161
## [10,] -0.0012290488
## [11,] -0.0006887333
## [12,] -0.0003327878
## [13,] -0.0001376085
## 
## 
## Upper Band, CI= 0.95 
## $Ingreso
##        Produccion
##  [1,] 0.788216448
##  [2,] 0.681723884
##  [3,] 0.437063770
##  [4,] 0.240192901
##  [5,] 0.152105717
##  [6,] 0.092204133
##  [7,] 0.056567646
##  [8,] 0.031738213
##  [9,] 0.018575645
## [10,] 0.011530680
## [11,] 0.007210329
## [12,] 0.004532758
## [13,] 0.002812355
plot(SVARrrp)

SVARrrp <- irf(SVARModelo01, impulse = "Ahorros", response = "Produccion", n.ahead = 12)
## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .

## Warning in SVAR(x = varboot, estmethod = c("scoring", "direct"), Amat = amat, :
## Convergence not achieved after 100 iterations. Convergence value: 1 .
SVARrrp
## 
## Impulse response coefficients
## $Ahorros
##          Produccion
##  [1,]  1.284954e-02
##  [2,] -2.943312e-02
##  [3,] -2.072663e-02
##  [4,] -1.317754e-02
##  [5,] -6.899300e-03
##  [6,] -3.638549e-03
##  [7,] -1.810873e-03
##  [8,] -9.093632e-04
##  [9,] -4.468605e-04
## [10,] -2.207943e-04
## [11,] -1.081467e-04
## [12,] -5.312643e-05
## [13,] -2.600338e-05
## 
## 
## Lower Band, CI= 0.95 
## $Ahorros
##          Produccion
##  [1,] -0.1453903644
##  [2,] -0.1080951060
##  [3,] -0.0643071773
##  [4,] -0.0417973561
##  [5,] -0.0268046409
##  [6,] -0.0173817457
##  [7,] -0.0111481238
##  [8,] -0.0071383859
##  [9,] -0.0045343274
## [10,] -0.0028838935
## [11,] -0.0018340721
## [12,] -0.0011671034
## [13,] -0.0007428757
## 
## 
## Upper Band, CI= 0.95 
## $Ahorros
##          Produccion
##  [1,]  4.986973e-02
##  [2,] -5.352620e-03
##  [3,] -7.608009e-03
##  [4,] -4.734781e-03
##  [5,] -1.870447e-03
##  [6,] -9.749159e-04
##  [7,] -2.998541e-04
##  [8,] -3.311620e-05
##  [9,]  2.987063e-05
## [10,]  3.526300e-05
## [11,]  5.213283e-05
## [12,]  3.676352e-05
## [13,]  2.002366e-05
plot(SVARrrp)

#Prediccion del error de la varianza

#número2

library(vars)
library(pdfetch)
## Warning: package 'pdfetch' was built under R version 4.2.3
library(tidyverse)
library(yuima)
## Warning: package 'yuima' was built under R version 4.2.3
## Loading required package: stats4
## Loading required package: expm
## Warning: package 'expm' was built under R version 4.2.3
## Loading required package: Matrix
## 
## Attaching package: 'Matrix'
## The following objects are masked from 'package:tidyr':
## 
##     expand, pack, unpack
## 
## Attaching package: 'expm'
## The following object is masked from 'package:Matrix':
## 
##     expm
## Loading required package: cubature
## Warning: package 'cubature' was built under R version 4.2.3
## Loading required package: mvtnorm
## ########################################
## This is YUIMA Project package v.1.15.22
## Why don't you try yuimaGUI package?
## Visit: http://www.yuima-project.com
## ########################################
## 
## Attaching package: 'yuima'
## The following object is masked from 'package:tibble':
## 
##     char
## The following object is masked from 'package:stats':
## 
##     simulate
NVDAdata <- pdfetch_YAHOO("NVDA",from = c("2019-01-01"),to = c("2023-03-01"), interval = '1d')
Novocure <- NVDAdata[,4]
length(Novocure)
## [1] 1047
tsNovoCure <- ts(Novocure, start = c(2019,1),frequency=365)

plot(tsNovoCure)

l_NovoCure<-diff(log(tsNovoCure))
plot(l_NovoCure)

Delta <- 1/365
alpha <- mean(l_NovoCure)/Delta
sigma <- sqrt(var(l_NovoCure)/Delta)
mu <- alpha +0.5*sigma^2
x0 <-tsNovoCure[1]

sigma
##            NVDA.close
## NVDA.close  0.6381373
mu
##            NVDA.close
## NVDA.close  0.8733985
nsim <- 1000
t <- 252
mu <- 0.792782
sigma <- 0.2855984
S0 <- 32.72
dt = 1/365

gbm_vec <- function(nsim = 1000, t = 1047, mu = 0.407048, sigma = 0.3703013, S0 = 32.72, dt = 1./365) {
  
  epsilon <- matrix(rnorm(t*nsim), ncol = nsim, nrow = t)
  gbm <- exp((mu - sigma * sigma / 2) * dt + sigma * epsilon * sqrt(dt))
  gbm <- apply(rbind(rep(S0, nsim), gbm), 2, cumprod)
  return(gbm)
}

gbm <- gbm_vec(nsim, t, mu, sigma, S0, dt)

gbm_df <- as.data.frame(gbm) %>%
  mutate(ix = 1:nrow(gbm)) %>%
  pivot_longer(-ix, names_to = 'sim', values_to = 'price')
gbm_df %>%
  ggplot(aes(x=ix, y=price, color=sim)) +
  geom_line() +
  theme(legend.position = 'none')

data.frame(price = gbm[253, ]) %>%
  ggplot(aes(x = price)) +
  geom_histogram(aes(y = ..density..), binwidth = 0.1) +
  geom_density() + 
  ggtitle('terminal price distribution')
## Warning: The dot-dot notation (`..density..`) was deprecated in ggplot2 3.4.0.
## ℹ Please use `after_stat(density)` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.

D <- gbm[253, ] %>%
  density()

D$x[which.max(D$y)]
## [1] 50.35078

#número3

El Modelo 1 esta enfocado en el análisis de series de tiempo y se utilizaron varias librerías de R para poder llevarlo a cabo. Normalmente se utiliza la librería vars para estimar un modelo VAR (Vector Autoregression) con tres variables (ingreso, producción y ahorros), se realiza un análisis de causalidad y se ajusta un modelo SVAR (Structural VAR) con restricciones. Por último, se realiza un análisis de impulso y se predice la varianza del error. El modelo 1 utiliza la librería “vars” en R para ajustar un modelo vectorial autorregresivo (VAR) con tres variables explicativas: ingreso, ahorros y producción. Se ajustan dos modelos VAR diferentes, uno con un orden p = 5 y otro con p = 1. Se utiliza el método de selección de lag más adecuado, y se comprueba la causalidad entre las tres variables del modelo. Se introducen restricciones en el modelo VAR para analizar su impacto en las predicciones de las variables dependientes. Finalmente, se utiliza el modelo ajustado para hacer predicciones sobre la evolución futura de las variables, y se analiza la varianza del error en la predicción. Por lo tanto, el modelo muestra varias técnicas de análisis de series de tiempo y ajuste de modelos VAR, así como también análisis de causalidad y predicciones de series de tiempo. Por otro lado, el Modelo 2 esta enfocado en el análisis de precios de acciones. Utiliza la librería pdfetch para obtener precios de la acción de una empresa, se ajusta un modelo de volatilidad de tipo GBM (Geometric Brownian Motion) y se simulan valores de la acción. Luego, se transforma el objeto de datos a un data frame y se usa ggplot para visualizar los resultados. El modelo 2 utiliza la librería “yuima” para simular un proceso de Browniano geométrico (GBM) que sigue la evolución del precio de las acciones de una empresa, en este caso NVDA Se utilizan los datos de precios históricos de las acciones de NVDA para ajustar el modelo GBM, y se realiza una simulación para predecir los precios futuros de las acciones. Se utilizaron técnicas de análisis de series de tiempo y simulación de procesos estocásticos para predecir los precios futuros de las acciones.

En resumen, mientras que el Modelo 1 se enfoca en análisis de series de tiempo multivariadas y la identificación de relaciones estructurales, el Modelo 2 se enfoca en el análisis de precios de acciones y la simulación de los mismos.