ARMAX model - Sinusoidal function

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

VictorV
Posts: 14
Joined: Thu May 24, 2012 6:16 am

ARMAX model - Sinusoidal function

Postby VictorV » Thu Dec 18, 2014 12:38 pm

I am trying to model an ARMAX model with both seasonal dummies and a sinusoidal function (see attachment). I currently have the following:
"p c x1 x2 x3 x4 x5 @trend sin(@trend*@acos(-1)/365) ar(1) ar(7) ar(14) ma(1)". where x are the indicator functions.

However now I am still missing the alpha8 from the model (see attachment) and I don't really know how to model this.

I cannot add another constant c and adding just a 'dummy' variable equal to 1 does not give the required result since Eviews will only estimate sin(@trend*@acos(-1)/365) as 1 variable, i.e. only alpha7. Does anyone know how I can get alpha8? I assume this should not be a very difficult problem to solve but I just can't figure out how I should do this.

Thanks!
Attachments
Price.PNG
Price.PNG (5.76 KiB) Viewed 2846 times

EViews Glenn
EViews Developer
Posts: 2620
Joined: Wed Oct 15, 2008 9:17 am

Re: ARMAX model - Sinusoidal function

Postby EViews Glenn » Mon Jan 05, 2015 10:00 pm

I just saw this for the first time (it's not really in the right forum group).

You can't do this by list. You have to specify your regression by expression, as in

p = c(1) + c(2)*x1 + ...

The relevant part you'll want is an expression with the coefficient defined explicitly, as in

c(8)*sin((@trend+c(9))*@acos(-1)/365)

This should be part of your expression equation.

VictorV
Posts: 14
Joined: Thu May 24, 2012 6:16 am

Re: ARMAX model - Sinusoidal function

Postby VictorV » Wed Jan 07, 2015 3:53 am

Thanks a lot! This should solve the problem. However how would I now correctly specify the MA term?

EViews Glenn
EViews Developer
Posts: 2620
Joined: Wed Oct 15, 2008 9:17 am

Re: ARMAX model - Sinusoidal function

Postby EViews Glenn » Wed Jan 07, 2015 6:04 am

Hadn't thought about the MA. I was just looking at the image of the conditional mean. Unfortunately, MA terms aren't allowed in equations specified by expression. So you're not going to be able to do the full specification using the equation. Sorry to get your hopes up.

The only thing you can do is to build the spec in a state space model. I'd go into the autospec, make the MA of the form that you want, then edit the spec to use your variables and restrictions.

VictorV
Posts: 14
Joined: Thu May 24, 2012 6:16 am

Re: ARMAX model - Sinusoidal function

Postby VictorV » Wed Jan 07, 2015 9:43 am

I'm sorry I don't really understand your state space solution. Could you explain this in more detail?
Thanks!

EViews Glenn
EViews Developer
Posts: 2620
Joined: Wed Oct 15, 2008 9:17 am

Re: ARMAX model - Sinusoidal function

Postby EViews Glenn » Wed Jan 07, 2015 2:26 pm

The state space object lets you estimate linear structural dynamic models that follow a particular form. ARMAX is one of the models that falls into this framework. The advantage of the state space object is that you can modify the specification to fit your particular needs; the downside is that you need to understand how the model syntax works. The manual describes the state space object in some detail. In addition, there is a tool in the state space object for constructing models of various forms. You can use that tool to construct a general specification for the state space object, and then modify it to fit your needs.

VictorV
Posts: 14
Joined: Thu May 24, 2012 6:16 am

Re: ARMAX model - Sinusoidal function

Postby VictorV » Wed Jan 07, 2015 3:09 pm

I actually need this model as the conditional mean equation for a GARCH model, i.e. ARMAX-GARCH. I assume that this will become very difficult using state space models for the conditional mean?

EViews Glenn
EViews Developer
Posts: 2620
Joined: Wed Oct 15, 2008 9:17 am

Re: ARMAX model - Sinusoidal function

Postby EViews Glenn » Thu Jan 08, 2015 6:40 am

It'll be difficult to do the GARCH part along with the MA in EViews, It's possible, but I can't think of an easy way to do it without you crafting your own optimization using either the LOGL object or the optimize command. There's nothing built-in that does the full set of what you want to do.

NicolasR
Posts: 85
Joined: Mon Nov 04, 2013 6:22 pm
Location: Here

Re: ARMAX model - Sinusoidal function

Postby NicolasR » Tue Jan 13, 2015 2:13 pm

I think that the sinusoidal function that you showed can be expressed as:

A1*Cos(2pit/365)+B1*Sin(2pit/365)
Where Alpha_7=(A1^2+B1^2)^(1/2) and Alpha_8=tan^-1(-B1/A1), which are the amplitude and the phase shift in radians. Therefore, you can perfom the estimation by list as:

Code: Select all

@cos(2*@acos(-1)*@trend/365) @sin(2*@acos(-1)*@trend/365)


In this way you can include MA tems and model the heteroskedasticity.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 7 guests