ImpulseResponseFunction
Calculation of Impulse Response Parameters for various time-series forecasters.
Direct interface to statsmodels.tsa.statespace.[any_non_var_vecm_model].[MODEL_FROM_MODEL_MAPPING].impulse_responses and statsmodels.tsa.vector_ar.irf.IRAnalysis.
Basically, an impulse reflects a simple input signal into a system. While system itself sounds very vague,in the context of time-series such a system can be simply a time series itself or a relationship between two time series. Especially in the context of time series, such a relationship is often assumed to be linear and dynamic and therefore to be found in in linear dynamic models such as VAR and VECM, but also in state-space models like Dynamic Factor (ignoring the fact we could write all time-series in statespace forms).
Going further, an impulse response traces how a one-time shock or sudden change of one time series variable within a system (of several time-series variables) unfolds over time in the whole system of all variables. Practical examples could be the shock/change in oil prices on gasoline prices, see for example: Chudik and Georgiadis 2019, “Estimation of impulse response functions when shocks are observed at a higher frequency than outcome variables.”, Working Paper No. 2307, European Central Bank.
The following sktime estimators support the calculation of an impulse response:
DynamicFactorVARVARMAXVECM
Quickstart
from sktime.param_est.impulse import ImpulseResponseFunction
estimator = ImpulseResponseFunction(model=None, steps=1, impulse=0, orthogonalized=False, cumulative=False, anchor=None, transformed=True, includes_fixed=False)Parameters(8)
- modelAny
A previous fitted
sktimetime series forecaster fromsktime.forecasting. See above for the current supportedsktimemodels.- stepsint, optional, default=1
- The number of steps for which impulse responses are calculated. Default is 1. Note that for time-invariant models, the initial impulse is not counted as a step, so if steps=1, the output will have 2 entries.
- impulseint, str or array_like, optional, default=0
- If an integer, the state innovation to pulse; must be between 0 and k_posdef-1. If a str, it indicates which column of df the unit (1) impulse is given. Alternatively, a custom impulse vector may be provided; must be shaped k_posdef x 1.
- orthogonalizedbool, optional, default=False
- Whether or not to perform impulse using orthogonalized innovations. Note that this will also affect custom impulse vectors.
- cumulativebool, optional, default=False
- Whether or not to return cumulative impulse responses.
- anchorint, str, or datetime, optional, default = #start#
- Time point within the sample for the state innovation impulse. Type depends on the index of the given endog in the model. Two special cases are the strings #start# and #end#, which refer to setting the impulse at the first and last points of the sample, respectively. Integer values can run from 0 to nobs - 1, or can be negative to apply negative indexing. Finally, if a date/time index was provided to the model, then this argument can be a date string to parse or a datetime type.
- transformedbool, optional, default=True
- Whether or not params is already transformed.
- includes_fixedbool, optional, default=False
- If parameters were previously fixed with the fix_params method, this argument describes whether or not params also includes the fixed parameters, in addition to the free parameters.
Examples
>>> from sktime.datasets import load_airline
>>> from sktime.param_est.impulse import ImpulseResponseFunction
>>> from sktime.forecasting.dynamic_factor import DynamicFactor as skdyn
>>> import pandas as pd
>>> X = load_airline ()
>>> X2 = X. shift (1). bfill ()
>>> df = pd. DataFrame ({ "X": X, "X2": X2 })
>>> fitted_model = skdyn (k_factors = 1, factor_order = 2). fit (df)
>>> sktime_irf = ImpulseResponseFunction (fitted_model, orthogonalized = True)
>>> sktime_irf. fit (df) ImpulseResponseFunction(
... )
>>> print (sktime_irf. get_fitted_params ()["irf" ]) [[1414.75907225 1401.6016836 ] [-1.45858745 -1.44502246]]References
Ballarin, G. 2025: Impulse Response Analysis of Structural Nonlinear
Time Series Models, https://arxiv.org/html/2305.19089v5
Statsmodels (last visited 15/02/2026): https://www.statsmodels.org/stable/generated/statsmodels.tsa.statespace.varmax.VARMAX.impulse_responses.html
Statsmodels (last visited 15/02/2026): https://www.statsmodels.org/stable/generated/statsmodels.tsa.statespace.dynamic_factor.DynamicFactor.impulse_responses.html
Statsmodels (last visited 01/03/2026): https://www.statsmodels.org/stable/generated/statsmodels.tsa.vector_ar.irf.IRAnalysis.html