FunctionalVARResult.projected_curves#

FunctionalVARResult.projected_curves()[source]#

The sample as the basis sees it, over the full sample.

Return type:

NDArray[double]

Returns:

An (nobs, n_points) array – each curve replaced by its projection onto the basis. The gap between this and curves is pure approximation error – what the basis cannot represent – before any dynamics enter.

Example

>>> import numpy as np
>>> rng = np.random.default_rng(0)
>>> grid = np.linspace(0.0, 1.0, 25)
>>> curves = 0.1 * np.cumsum(rng.standard_normal(80))[:, None] + np.sin(np.pi * grid)
>>> curves = curves + 0.01 * rng.standard_normal((80, 25))
>>> res = FunctionalVAR(curves, grid, order=1, basis="fpca", n_components=1).fit()
>>> gap = curves - res.projected_curves()
>>> gap.shape, bool(np.abs(gap).max() < 0.05)
((80, 25), True)