IVAE
Librería
Importación de datos
Serie temporal IVAE
IVAEDesPivot %>% select(texto, Valor, fecha) %>% filter(texto == "IVAE") -> IVAE1
Serie.IVAE1.ts <- ts(data = IVAE1$Valor,
start = c(2005, 1),
frequency = 12)
Serie.IVAE1.ts %>%
autoplot() +
geom_vline(xintercept = 2020.25, linetype = "dashed", color = "red", alpha = 0.5) +
annotate("text", x = 2020.5, y = 90, label = "Impacto COVID-19", color = "red", angle = 90, vjust = -0.5) +
theme_light() +
labs(
title = "Índice de Volumen de la Actividad Económica (IVAE)",
subtitle = "El Salvador: Periodo 2005 - Octubre 2025",
caption = "Fuente: Elaboración propia basada en datos del BCR",
x = "Año / Mes",
y = "Índice"
) +
theme_minimal() + # Fondo blanco y limpio
theme(
plot.title = element_text(face = "bold", size = 16, color = "darkblue"),
plot.subtitle = element_text(size = 12),
axis.title = element_text(face = "italic") # + geom_point()
) Pronóstico IVAE
## Series: IVAE1$Valor
## ARIMA(0,1,0) with drift
##
## Coefficients:
## drift
## 0.2000
## s.e. 0.1213
##
## sigma^2 = 3.678: log likelihood = -514.97
## AIC=1033.95 AICc=1033.99 BIC=1040.98
##
## Training set error measures:
## ME RMSE MAE MPE MAPE MASE
## Training set 0.0003199998 1.910232 1.22592 -0.02192619 1.236005 0.9746299
## ACF1
## Training set 0.02499106
# Tabla
pronostico.arima.automatico<-forecast(
object = IVAEArimaAutomatico,h = 12,level = c(.95)) %>% print()## Point Forecast Lo 95 Hi 95
## 251 130.2 126.4409 133.9591
## 252 130.4 125.0839 135.7161
## 253 130.6 124.0891 137.1109
## 254 130.8 123.2819 138.3181
## 255 131.0 122.5945 139.4055
## 256 131.2 121.9922 140.4078
## 257 131.4 121.4545 141.3455
## 258 131.6 120.9678 142.2322
## 259 131.8 120.5228 143.0772
## 260 132.0 120.1128 143.8872
## 261 132.2 119.7326 144.6674
## 262 132.4 119.3783 145.4217
# Gráfica
library(ggplot2)
# Guardamos el autoplot en un objeto para modificarlo
GraficaIVAE <- forecast(IVAEArimaAutomatico, h = 4, level = c(95)) %>%
autoplot(predict.colour = "red", # Línea de la predicción en rojo
predict.linetype = "dashed", # Línea punteada para el futuro
conf.int.fill = "#5b9bd5", # Color azul suave para el intervalo
conf.int.alpha = 0.3) # Transparencia del intervalo
# Añadimos capas de formato
GraficaIVAE +
labs(
title = "Proyección de la Actividad Económica (IVAE)",
subtitle = "Pronóstico para los próximos 4 periodos | Confianza 95%",
x = "Año",
y = "Índice (Base 100)",
caption = "Fuente: Elaboración propia basada en datos del BCR"
) +
theme_minimal() + # Limpia el fondo gris
theme(
plot.title = element_text(face = "bold", size = 14),
panel.grid.minor = element_blank() # Quita líneas de cuadrícula pequeñas
)Serie temporal Agricultura, ganadería, silvicultura y pesca
IVAEDesPivot %>% select(texto, Valor, fecha) %>% filter(texto == 'Agricultura, ganadería, silvicultura y pesca') -> IVAE2
Serie.IVAE2.ts <- ts(data = IVAE2$Valor,
start = c(2005, 1),
frequency = 12)
Serie.IVAE2.ts %>%
autoplot() +
geom_vline(xintercept = 2020.25, linetype = "dashed", color = "red", alpha = 0.5) +
annotate("text", x = 2020.5, y = 90, label = "Impacto COVID-19", color = "red", angle = 90, vjust = -0.5) +
theme_light() +
labs(
title = "Agricultura, ganadería, silvicultura y pesca",
subtitle = "El Salvador: Periodo 2005 - Octubre 2025",
caption = "Fuente: Elaboración propia basada en datos del BCR",
x = "Año / Mes",
y = "Índice"
) +
theme_minimal() + # Fondo blanco y limpio
theme(
plot.title = element_text(face = "bold", size = 16, color = "darkblue"),
plot.subtitle = element_text(size = 12),
axis.title = element_text(face = "italic")
)Serie temporal Índice de Producción Industrial (IPI): industrias manufactureras, explotación de minas y canteras y otras actividades industriales
IVAEDesPivot %>%
select(texto, Valor, fecha) %>%
filter(texto ==
'Índice de Producción Industrial (IPI): industrias manufactureras, explotación de minas y canteras y otras actividades industriales') -> IVAE3
Serie.IVAE3.ts <- ts(data = IVAE3$Valor,
start = c(2005, 1),
frequency = 12)
Serie.IVAE3.ts %>%
autoplot() +
geom_vline(xintercept = 2020.25, linetype = "dashed", color = "red", alpha = 0.5) +
annotate("text", x = 2020.5, y = 90, label = "Impacto COVID-19", color = "red", angle = 90, vjust = -0.5) +
theme_light() +
labs(
title = "Índice de Producción Industrial (IPI)",
subtitle = "El Salvador (industrias manufactureras, explotación de minas y canteras y otras actividades industriales): Periodo 2005 - Octubre 2025",
caption = "Fuente: Elaboración propia basada en datos del BCR",
x = "Año / Mes",
y = "Índice"
) +
theme_minimal() + # Fondo blanco y limpio
theme(
plot.title = element_text(face = "bold", size = 16, color = "darkblue"),
plot.subtitle = element_text(size = 12),
axis.title = element_text(face = "italic")
)