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

Using lagged x variables in regression #74

Open
azev77 opened this issue Nov 3, 2020 · 1 comment
Open

Using lagged x variables in regression #74

azev77 opened this issue Nov 3, 2020 · 1 comment

Comments

@azev77
Copy link
Contributor

azev77 commented Nov 3, 2020

I wanna write a blog post along the lines of "which variables are harder to forecast"...

auto_arma works great:

using FredData;
f = Fred("Personal api_key");  
#
d = get_data(f, "GDP");     y=d.df[:,4]
d = get_data(f, "PCEC");    c=d.df[:,4]
d = get_data(f, "GPDI");    i=d.df[:,4]
d = get_data(f, "GCE");     g=d.df[:,4]
d = get_data(f, "NETEXP");  nx=d.df[:,4]
[filter!(x -> ! isnan(x), dd) for dd in [y, c, i, g, nx]]; # REMOVE NaN

using ARCHModels;
auto_arma(df, ic) = selectmodel(ARCH{0}, df, meanspec=ARMA, criterion=ic, minlags=0, maxlags=3);
#
sc_aic=[]
for dd in [y, c, i, g, nx]
	a=auto_arma(dd, aic)
	push!(sc_aic,(a.spec,a.meanspec,aic(a),bic(a),a))
end
sc_aic

Is there a convenient way to include controls together with ARMA?
y_{t+1} = \mu + \rho_y * y_t + \rho_c * c_t +\rho_i1 * i_{t-1} + \epsilon_{t+1}

@s-broda
Copy link
Owner

s-broda commented Nov 9, 2020

Not at the moment, I'm afraid.

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

No branches or pull requests

2 participants