Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: allow exogenous variable to be numpy 2-d array #517

Open
lfdmotta opened this issue Jul 29, 2021 · 3 comments
Open

ENH: allow exogenous variable to be numpy 2-d array #517

lfdmotta opened this issue Jul 29, 2021 · 3 comments

Comments

@lfdmotta
Copy link

lfdmotta commented Jul 29, 2021

Hi,
I'd like to suggest that the forecast method of the arch model result be capable of accepting exogenous variables as (horizon, scenario), 2d numpy array. Right now, the solution with a for-loop for every scenario x does not take advantage of matrix multiplication that can be done more efficiently:

$$ y_{t+1, i_scenario} = \beta 1_{i_scenario, j_scenario} x_{t+1, j_scenario} + \ldots $$

and this slows down computations considerably for someone calculating simulations for several paths and several time-series $y_t$ for a single task, say if one wants to look at several risk factors that have an exogenous systemic risk factor.

This would be useful if the output includes y_t for each scenario (not only unconditional means).

@bashtage
Copy link
Owner

This can't work since exogenous variables are already 2d since AR-X can have multiple X, and so you have to be able to pass 2-d for specify the values of all X's. I think this is probably too specialized a request to get in, especially since you want to have multiple parameter values and multiple x-values.

@lfdmotta
Copy link
Author

It's a feature available in rugarch package and it seems very useful for anyone working in finance. In rugarch it accepts a list of data frames, the list has the length equal to the number of external regressors. In python it could be a 3d numpy array.

@bashtage
Copy link
Owner

I'm open to a PR but am unlikely to implement this myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants