Skip to content
All library documents

Reconstructing Time Series with Principal Components

Article Quant Q&A · Author: ManInMoon

Summary

The document asks how to reconstruct two related time series, unleaded and diesel prices, using principal component analysis. It provides eigenvalues and eigenvectors for the two price columns and wants to compare the original series with reconstructions using the first component, the second component, or both components. This is a dimensionality-reduction question: project observations onto selected principal component directions, then map those scores back through the corresponding eigenvectors to obtain reconstructed values.

The example does not provide the full dataset, explain whether PCA was applied to centered or standardized prices, or show a reconstruction. Those choices matter: PCA reconstruction is ordinarily performed in the transformed space used to fit PCA, with any centering or scaling reversed afterward. Retaining both components in a two-variable dataset reproduces the transformed input apart from numerical precision, while retaining only one gives an approximation. The desired comparison is graphical, but no results are reported.

Key ideas

  • PCA represents observations as scores along orthogonal directions defined by eigenvectors.
  • A reconstruction uses the selected component scores and their eigenvectors to map back into the original variable space.
  • Keeping one component gives an approximation, while retaining both components preserves the two-variable information subject to preprocessing and numerical precision.
  • Centering or scaling choices affect how reconstructed values should be interpreted and plotted.

Tags

Full text
# How replicate data using PCA


# How replicate data using PCA












I have a set of date covering petrol prices.

My example has two columns where each row represents a sequential date.

```
   unleaded diesel
1   1.39     1.35
2   1.3901   1.3502
3   1.3902   1.3501
.....
```

I generate eigen values:

my.eigen $values [1] 7.053791e-07 9.097811e-08

```
$vectors
             PC1        PC2
unleaded 0.6489256 -0.7608519
diesel   0.7608519  0.6489256
```

my.eigen $values [1] 7.053791e-07 9.097811e-08

How can I produce a timeseries using the first, second or first two Components. That would give me something that replicates(but of course is different to) the original data?

I would like to plot unleaded, diesel timeseries against the "replicated" data for different inclusion of components.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.