Page 2 of 2
Re: Excel and EViews 8 with VBA code
Posted: Tue Jan 20, 2015 12:37 pm
by EViews Gareth
ok, now we're getting somewhere.
All you need to do is add the code I provided above, then fetch the numbers back.
Just add these lines to your VBA:
Code: Select all
Dim Kurt
Dim Skew
app.Run "equation eq1.ARCH(DERIV=AA) serie_1 C AR(1)"
app.Run "scalar kurt = @kurt(resid)"
app.Run "scalar skew = @skew(resid)"
Kurt = app.Get("kurt")
Skew = app.Get("skew")
Cells(3, 7) = Kurt
Cells(4, 7) = Skew
Re: Excel and EViews 8 with VBA code
Posted: Tue Jan 20, 2015 1:07 pm
by Ziller
Thank you so much! I think it worked properlly!
I just need one more thing: using the same equation, calculate and then export to Excel the GARCH Variance Series.
One step to heaven! hahahaha...
Re: Excel and EViews 8 with VBA code
Posted: Tue Jan 20, 2015 2:41 pm
by EViews Gareth
The EViews command to make the garch series is:
You can then bring it back in with the VBA method app.getseries, as outlined in the whitepaper.
Re: Excel and EViews 8 with VBA code
Posted: Fri Jan 23, 2015 11:02 am
by Ziller
Hello! It´s me bothering you again...
Sorry!!! hahahaha
Using the codes I´m using, I´m not calculating the residual serie, is that correct?
I´d like to obtain kurtosis and skewness of the residual series. Is there a way to do that?
Another doubt I have: when running GARCH on Eviews 8, I´m obtaining results that are different than running it on EViews 6. So far, the only difference I could notice is that on EViews 8 the results are obtained after 54 iterations, and on EViews 6 are obtained after 13 iterations, as seen on the file attached.
I´ve checked all the options and did´nt found any configuration differences between those files. Does anybody knows what may be happening?
Thanks again!!!
Re: Excel and EViews 8 with VBA code
Posted: Fri Jan 23, 2015 11:13 am
by EViews Gareth
EViews calculates the residuals automatically. So you don't need to.
Probably just improved algorithms between 6 and 8.
Re: Excel and EViews 8 with VBA code
Posted: Fri Jan 23, 2015 11:27 am
by Ziller
I´m calculating using the VBA code you sent me, like above:
app.Run "equation eq1boi_gordo.ARCH(DERIV=AA) boi_gordo C AR(1)"
app.Run "scalar kurt = @kurt(resid)"
app.Run "scalar skew = @skew(resid)"
Using this, @kurt is 4.702 and @skew is -0.1398.
Calculating manually, I follow these steps:
1) Clik on eq1;
2) Estimate > OK.
3) Proc > Make Residual Series - Select Standard - and then OK.
4) On the residual series (resid01, by default), the kustosis obtainded is 3.800 and skewness is 0.05.
What´s the difference between what I´m doing manually and the VBA?
Thanks!
Re: Excel and EViews 8 with VBA code
Posted: Fri Jan 23, 2015 11:49 am
by EViews Gareth
You're calculating the kurtosis and skewness of the standardised residuals, not the ordinary. Are you sure that's what you want to do?
Re: Excel and EViews 8 with VBA code
Posted: Fri Jan 23, 2015 12:00 pm
by Ziller
Yes, I need to calculate from standardized... Is there a way I could change the VBA and insert this parameter?
Re: Excel and EViews 8 with VBA code
Posted: Fri Jan 23, 2015 12:14 pm
by EViews Gareth
Code: Select all
eq1.makeresids(s) myresids
scalar kurt = @kurt(myresids)
scalar skew = @skew(myresids)
Re: Excel and EViews 8 with VBA code
Posted: Mon Jan 26, 2015 6:01 am
by Ziller
I think this will be my last doubt... THANK GOD and also THANK GARETH!!! hahahaha
All OK generating GARCH variance series and all stuff, but I´m having trouble with getseries.
The VBA I´m using is the following:
app.Run "eq1cafe.makegarch mygarch"
Set range_garch = Sheets("Dados").Range("O2:O507")
o = app.GetSeries("mygarch")
range_garch = o
What am I doing wrong?
Again, thank you so much!!!
Re: Excel and EViews 8 with VBA code
Posted: Mon Jan 26, 2015 9:25 am
by EViews Steve
GetSeries returns a 1-dimensional array. I believe Excel Range objects expect a 2-dimensional array.
I would suggest you read our COM Automation documentation located here:
http://www.eviews.com/download/whitepap ... mation.pdf
And pay particular attention to the GetGroup method that returns a 2-dimensional array. Here's an excerpt from Page 5:
Code: Select all
'Excel VBA Example – Retrieve series "x" and series "y" (along with the date labels) for date range 1980 thru 1990
Dim o
o = app.GetGroup("@date x y", "1980 1990", NATypeAsExcelNA)
Dim rows, cols As Integer
rows = UBound(o, 1) – LBound(o, 1) + 1 'number of rows in returned object
cols = UBound(o, 2) – LBound(o, 2) + 1 'number of columns in returned object
Dim wsht as Worksheet
Set wsht = ActiveSheet
Dim rng
Set rng = wsht.Range(wsht.Cells(1, 1), wsht.Cells(rows, cols))
rng.Value = o 'puts data into top left corner of sheet
Steve
Re: Excel and EViews 8 with VBA code
Posted: Fri Mar 09, 2018 6:08 am
by oliveira83
If I have two pages on the same workfile how can I select one of them to get a group?
Re: Excel and EViews 8 with VBA code
Posted: Fri Mar 09, 2018 6:15 am
by EViews Gareth
Pageselect