rolling regression program

For posting your own programs to share with others

Moderators: EViews Gareth, EViews Moderator

justynaka2187
Posts: 2
Joined: Tue Sep 20, 2011 9:33 am

rolling regression program

Postby justynaka2187 » Tue Sep 20, 2011 9:42 am

Hello,
I was hoping if any of you could help me with my problem. I am quite new to eviews programing but i managed to program rolling regression for my forecast, but when i run it i the results I am getting are pretty strange, firstly the equation I am getting has very large (in absolute terms) t statistics and my R^2 ( also adjusted ) is equall to 1 , then when i do the forecast from this equation I m just getting back 3 dots in the graph coresponding to one date, also I dont get statistics like MAE etc back. Here is the program I am using:
smpl @all
scalar n =@obs(hml)
scalar window = 60
series hml
equation e
for !i=0 to n-window-1
smpl @first+!i @first+!i+window-1
e.ls hml c erp tb3m yieldspr(-1) defspr credspr(-2)
smpl @first+!i+window @first+!i+window
hml =@coefs(1) +@coefs(2)*erp + @coefs(3)*tb3m +@coefs(4)*yieldspr(-1) + @coefs(5)*defspr +@coefs(6)*credspr(-2)
next
delete window n

I would highly appreciate if any of you could help me!
Thanks!

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13294
Joined: Tue Sep 16, 2008 5:38 pm

Re: rolling regression program

Postby EViews Gareth » Tue Sep 20, 2011 9:49 am

There's a few things in there that don't make sense to me.

1) The line that says:

Code: Select all

series hml

This line would usually be used to declare a new (empty) series. However in your case, I suspect that there is already a series called HML (since you've used it in the @obs function above). Thus this line does nothing, I suspect.

2) The line where you're doing your forecast. You appear to be assigning the forecast value on top of the actual data value. This is almost certainly not what you wanted to do.

Perhaps you meant to assign the forecasts to a new series, called something else. So perhaps your program should be:

Code: Select all

smpl @all
scalar n =@obs(hml)
scalar window = 60
series hml_f
equation e
for !i=0 to n-window-1
smpl @first+!i @first+!i+window-1
e.ls hml c erp tb3m yieldspr(-1) defspr credspr(-2)
smpl @first+!i+window @first+!i+window
hml_f =@coefs(1) +@coefs(2)*erp + @coefs(3)*tb3m +@coefs(4)*yieldspr(-1) + @coefs(5)*defspr +@coefs(6)*credspr(-2)
next
delete window n


I don't see anywhere that you're calculating MAE, so that's probably why you're not seeing it.
Follow us on Twitter @IHSEViews

justynaka2187
Posts: 2
Joined: Tue Sep 20, 2011 9:33 am

Re: rolling regression program

Postby justynaka2187 » Tue Sep 20, 2011 10:38 am

Thank you so much for your reply, as said I am quite new to programming in Eviews therefore I couldn't spot the mistake I was doing. So again thank you for your help, could you tell me how do I include the formula to calculate the forecast statistics in this program?

Rolando Eduardo
Posts: 2
Joined: Thu Feb 18, 2016 11:54 am

Re: rolling regression program

Postby Rolando Eduardo » Thu Feb 18, 2016 12:23 pm

Hi
I am doing a web application to forecast data, local environment makes good operation command execution, but when we built a site using IIS with OS Windows Server, at the time of prognosis in this distributed environment sends an error message , below:

"GetApplication Could not create instance of EViews Application object"

in some other forecasts and sent me the following message

Retrieving the COM class factory for component With CLSID {1B262E94-366E-4EB5-90A8-0A74B5B56B48} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) .- The directory exists-exists-file was written File- I enter the conditional


Rolando Eduardo

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13294
Joined: Tue Sep 16, 2008 5:38 pm

Re: rolling regression program

Postby EViews Gareth » Thu Feb 18, 2016 12:25 pm

email support@eviews.com along with your EViews serial number.
Follow us on Twitter @IHSEViews

Rolando Eduardo
Posts: 2
Joined: Thu Feb 18, 2016 11:54 am

Re: rolling regression program

Postby Rolando Eduardo » Fri Feb 19, 2016 4:30 pm

I have a trial version, I'm developing in .NET and I forecast the error occurred (1) to want to evaluate Web service, we are very confident in the results forecast EVIEWS, and established interface with EVIEWS from .net, only we have yet this error, if the error had we can buy eviews, Greetings

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13294
Joined: Tue Sep 16, 2008 5:38 pm

Re: rolling regression program

Postby EViews Gareth » Fri Feb 19, 2016 5:05 pm

EViews Gareth wrote:email support@eviews.com along with your EViews serial number.
Follow us on Twitter @IHSEViews


Return to “Program Repository”

Who is online

Users browsing this forum: No registered users and 8 guests