Suppose that I have fitted a linear regression model that takes the following general form:
where Y
is my target, i = {1, ...n}
is the number of explanatory variables Xs
and t
, is indexing time. So, is time series. beta
is the coefficient of the estimated equation.
I want to do a Historical Variance decomposition to understand the contribution of each X on the evolution of y
For example like this: https://medium.com/bonothesauro/deficits-are-raising-interest-rates-but-other-factors-are-lowering-them-6d1e68776b7a
Can someone help me implement this in R or Python ? So, far I found no source only for VAR models. But I am interested in more simpler linear regressions.