PM10 Dataset Example

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

This vignette shows how to use the built-in pm10 dataset with tsqn.

library(tsqn)
data("pm10")

dim(pm10)
head(pm10)

The complete dataset has 1826 observations for 8 monitoring stations. For faster examples in this vignette, we use the first 365 observations.

pm10_subset <- as.matrix(pm10[1:365, ])

qn_cor <- corMatQn(pm10_subset)
qn_cov <- covMatQn(pm10_subset)

round(qn_cor, 3)
round(qn_cov, 1)

Robust ACF and robust spectral analysis for one station:

vix <- pm10_subset[, "VixCentro"]

acf_qn <- robacf(vix, lag.max = 24, type = "correlation", plot = FALSE)
head(acf_qn$acf[, 1, 1], 10)

per_qn <- PerQn(vix)
length(per_qn)
head(per_qn, 10)

GPH_estimate(vix, method = "GPH-Qn")
tsqn:::plot.robacf(acf_qn, main = "PM10 Robust ACF (VixCentro)")

For comparison, the classical (standard) ACF is:

stats::acf(vix, lag.max = 24, main = "PM10 Standard ACF (VixCentro)")


Try the tsqn package in your browser

Any scripts or data that you put into this service are public.

tsqn documentation built on March 17, 2026, 1:07 a.m.