Introducción

Este informe presenta la exploración inicial de la cotización mensual de cierre del dólar estadounidense (USD) en guaraníes (PYG) en Paraguay, utilizando datos del Banco Central del Paraguay (BCP) para el período disponible. Se trabaja con una serie mensual de cierre, donde cada observación corresponde al último día hábil de cada mes.

Carga y preparación de datos

ruta_mensual <- here::here("proyecto", "data", "transformados", "cotizacion_usd_mensual.csv")
cotizaciones_mensual <- readr::read_csv(ruta_mensual, show_col_types = FALSE) |>
  janitor::clean_names() |>
  mutate(
    fecha_cierre = as.Date(fecha_cierre),
    anho         = as.integer(anho),
    mes          = as.integer(mes),
    cotizacion   = as.numeric(cotizacion),
    periodo      = as.factor(periodo)
  )
glimpse(cotizaciones_mensual)
## Rows: 299
## Columns: 5
## $ fecha_cierre <date> 2025-11-28, 2025-10-31, 2025-09-30, 2025-08-29, 2025-07-31, 2025-06-30, 2025-05-30, 2025-04-3…
## $ periodo      <fct> 2025-11, 2025-10, 2025-09, 2025-08, 2025-07, 2025-06, 2025-05, 2025-04, 2025-03, 2025-02, 2025…
## $ anho         <int> 2025, 2025, 2025, 2025, 2025, 2025, 2025, 2025, 2025, 2025, 2025, 2024, 2024, 2024, 2024, 2024…
## $ mes          <int> 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 12, 11, 10, 9, 8, 7,…
## $ cotizacion   <dbl> 6982.22, 7104.85, 7002.41, 7327.49, 7430.78, 7784.15, 7959.39, 8006.85, 7994.25, 7923.42, 7877…

Resúmenes estadísticos

resumen_global_cot <- summary(cotizaciones_mensual$cotizacion)
tabla_anhos <- table(cotizaciones_mensual$anho)
tabla_meses <- table(cotizaciones_mensual$mes)

resumen_anual <- cotizaciones_mensual |>
  group_by(anho) |>
  summarise(
    n_meses = n(),
    media   = mean(cotizacion, na.rm = TRUE),
    sd      = sd(cotizacion, na.rm = TRUE),
    min     = min(cotizacion, na.rm = TRUE),
    q1      = quantile(cotizacion, 0.25, na.rm = TRUE),
    mediana = median(cotizacion, na.rm = TRUE),
    q3      = quantile(cotizacion, 0.75, na.rm = TRUE),
    max     = max(cotizacion, na.rm = TRUE),
    .groups = "drop"
  )

resumen_mensual <- cotizaciones_mensual |>
  group_by(mes) |>
  summarise(
    n_obs   = n(),
    media   = mean(cotizacion, na.rm = TRUE),
    sd      = sd(cotizacion, na.rm = TRUE),
    min     = min(cotizacion, na.rm = TRUE),
    q1      = quantile(cotizacion, 0.25, na.rm = TRUE),
    mediana = median(cotizacion, na.rm = TRUE),
    q3      = quantile(cotizacion, 0.75, na.rm = TRUE),
    max     = max(cotizacion, na.rm = TRUE),
    .groups = "drop"
  ) |>
  arrange(mes)

resumen_global_cot
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    3586    4718    5657    5679    6505    8007
tabla_anhos
## 
## 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 
##   12   12   12   12   12   12   12   12   12   12   12   12   12   12   12   12   12   12   12   12   12   12   12 
## 2024 2025 
##   12   11
tabla_meses
## 
##  1  2  3  4  5  6  7  8  9 10 11 12 
## 25 25 25 25 25 25 25 25 25 25 25 24
resumen_anual
## # A tibble: 25 × 9
##     anho n_meses media    sd   min    q1 mediana    q3   max
##    <int>   <int> <dbl> <dbl> <dbl> <dbl>   <dbl> <dbl> <dbl>
##  1  2001      12 4145. 394.   3586 3794.   4145  4486.  4700
##  2  2002      12 5748. 807.   4825 4920    5900  6262.  7000
##  3  2003      12 6407. 368.   6000 6172.   6235  6850   6950
##  4  2004      12 5988. 148.   5725 5904.   5948. 6076.  6240
##  5  2005      12 6158. 107.   5970 6092.   6132. 6246.  6330
##  6  2006      12 5605  295.   5170 5395    5515  5778.  6130
##  7  2007      12 5033. 147.   4730 4985    5060  5110   5250
##  8  2008      12 4348. 381.   3930 3998.   4240  4622.  4930
##  9  2009      12 4956. 153.   4600 4875    5000  5065   5120
## 10  2010      12 4741.  87.6  4558 4710.   4736. 4759.  4938
## # ℹ 15 more rows
resumen_mensual
## # A tibble: 12 × 9
##      mes n_obs media    sd   min    q1 mediana    q3   max
##    <int> <int> <dbl> <dbl> <dbl> <dbl>   <dbl> <dbl> <dbl>
##  1     1    25 5723. 1128.  3586 4730    5777. 6531. 7877.
##  2     2    25 5636. 1143.  3745 4706    5565. 6510. 7923.
##  3     3    25 5599. 1159.  3790 4698    5629. 6311. 7994.
##  4     4    25 5582. 1183.  3795 4712    5571. 6500. 8007.
##  5     5    25 5627. 1146.  3850 4741    5709. 6274. 7959.
##  6     6    25 5637. 1118.  3930 4756    5589. 6200  7784.
##  7     7    25 5617. 1108.  3834 4749    5555. 6000  7583.
##  8     8    25 5667. 1119.  3892 4767    5654. 6252. 7684.
##  9     9    25 5704. 1089.  3990 4821    5657. 6380. 7799.
## 10    10    25 5797. 1082.  4217 4860    5723. 6450  7874.
## 11    11    25 5812. 1063.  4412 4730    5840. 6838. 7798.
## 12    12    24 5745. 1079.  4224 4634.   5787. 6561. 7831.

Visualización de la serie temporal

p_ts <- ggplot(cotizaciones_mensual, aes(x = fecha_cierre, y = cotizacion)) +
  geom_line() +
  geom_point(size = 0.8) +
  labs(
    title = "Evolución de la cotización mensual de cierre (USD/GS)",
    x     = "Fecha de cierre mensual",
    y     = "Cotización (Gs por USD)"
  ) +
  theme_minimal()
p_ts

Distribución y variabilidad

p_hist <- ggplot(cotizaciones_mensual, aes(x = cotizacion)) +
  geom_histogram(bins = 30) +
  labs(
    title = "Distribución de la cotización mensual de cierre",
    x     = "Cotización (Gs por USD)",
    y     = "Frecuencia"
  ) +
  theme_minimal()
p_hist

anho_max <- max(cotizaciones_mensual$anho, na.rm = TRUE)
p_box_anual <- cotizaciones_mensual |>
  filter(anho >= anho_max - 9) |>
  ggplot(aes(x = factor(anho), y = cotizacion)) +
  geom_boxplot() +
  labs(
    title = "Boxplot de cotización mensual por año (últimos 10 años)",
    x     = "Año",
    y     = "Cotización (Gs por USD)"
  ) +
  theme_minimal()
p_box_anual

Comentarios e interpretación

A partir de los resúmenes y gráficos presentados, se sugiere discutir en el informe:

Estas observaciones constituyen la base para formular hipótesis formales en etapas posteriores del proyecto, como pruebas de hipótesis o modelos de regresión sobre la dinámica de la cotización del USD.