FunctionalCoefficientVARResult._matrix_at#

FunctionalCoefficientVARResult._matrix_at(u)[source]#

The full (w, k) coefficient matrix at one state value.

Linear interpolation between the two bracketing grid points – exact at grid points, and refusing to extrapolate: a kernel estimate outside the data’s state range is a guess about a region the estimator never saw.

Parameters:

u (float) – A state value inside state_range.

Return type:

NDArray[double]

Returns:

The (w, k) matrix in design-row order.

Raises:

SpecificationError – If u lies outside the estimated range.

Example

>>> import numpy as np
>>> y = np.random.default_rng(0).standard_normal((150, 2))
>>> res = FunctionalCoefficientVAR(y, order=1, transition_variable="y1").fit(
...     bandwidth=1.0, n_grid=11
... )
>>> bool(np.allclose(res._matrix_at(float(res.grid[4])), res.curves[4]))
True
>>> midpoint = 0.5 * (res.grid[4] + res.grid[5])
>>> blend = 0.5 * (res.curves[4] + res.curves[5])
>>> bool(np.allclose(res._matrix_at(float(midpoint)), blend))
True