QVARResult.coefficients#
- QVARResult.coefficients(quantile)[source]#
One level’s lag stack
A_1(tau), ..., A_p(tau).- Parameters:
quantile (
float) – An estimated level.- Return type:
- Returns:
A
(p, k, k)stack;[l - 1, i, j]is the coefficient on laglof variablejin thetau-quantile equation of variablei.- Raises:
SpecificationError – If the level was not estimated.
Example
>>> import numpy as np >>> rng = np.random.default_rng(0) >>> y = np.zeros((300, 2)) >>> for t in range(1, 300): ... y[t] = 0.5 * y[t - 1] + rng.standard_normal(2) >>> res = QVAR(y, order=1).fit(quantiles=(0.25, 0.5, 0.75)) >>> res.coefficients(0.5).shape (1, 2, 2) >>> bool(np.all(np.abs(np.diag(res.coefficients(0.5)[0]) - 0.5) < 0.15)) True >>> bool(np.allclose(res.coefficients(0.75), res.coefficient_stacks[2])) True