p-values tests
by alexkakashi@libero.it
Dear Gretl-users
I have analyzed a trivariate system X,Y,Z. In particular I have studied
Granger causality from X to Y. I have the following result:
ols Y const Y(-1) X(-1) Z(-1)
# Granger-type restriction for p=1
restrict
b[1,3] = 0
end restrict
Statistica test: F(1, 51) = 1,88323, con p-value = 0,175973
Then, I have also applied this command using VAR model (estimated by OLS):
sys <- system
equation Y const Y(-1) X(-1) Z(-1)
equation X const Y(-1) X(-1) Z(-1)
equation Z const Y(-1) X(-1) Z(-1)
end system
# Granger-type restriction
restrict sys
b[1,3] = 0
end restrict
estimate sys method=ols
Test F per i vincoli specificati:
F(1,153) = 1,88323 [0,1720]
The test statistics are equal, but the p-values are slightly different. Why do
we have this difference? I think that in the second case we consider the
critical values of the F-distribution F(1,nT − n^(2)p − n) where n is the
number of variables, p is the model order. Is it right?
Best regards
Alessandro
12 years, 9 months
Re: [Gretl-users] VECM of High and Lows
by Daniel Bencik
Hello Allin,
how could this happen? If I have a significantly better forecast of the High and of Low, how can there be no gains in forecasting their difference? Im not expecting a three-fold increase in RSQ of (High - Low) modeling, however DMW test shows that forecasts from the base model and the rich model are indistinguishable from each other in terms of quality and this is rather unexpected for me.
Is there a way for me to reconstruct the (in sample) predicted series from a VECM model? There is a "Save residuals for Eq1 and Eq2" in Model results window, do these residuals apply to High/Low prices or d_High/d_Low when I have a VECM 7 1 High Low?
Thank you!
Daniel
12 years, 9 months
VECM of High and Lows
by Daniel Bencik
Dear all,
I have two models for daily ranges prediction, one of them being a pure VECM of high and low prices and the other one being the same augmented by other variables. On in sample, the first model has RSQ~20% for both variables, the second has RSQ~55% both both. However, when I do rolling forecasts, the forecasts end up being nearly the same, DMW test says they are of the same quality. And this is surprising for everybody I told. I use the following script for rolling window forecasting. Am I doing everything all right? The OOS forecasts are different by manual comparison, but their statistical similarity is striking.
Thank you,
Daniel
# We create one-step-ahead forecasts of models estimated on a rolling window of 400 observations
#OOSMatrix contains predictions of daily ranges, i.e. dailyHigh - dailyLow
#open D:\Thesis\Rolling_Forecasts\total_data.gdt
smpl full
scalar DataLen = $nobs
scalar WindowLen = 400
scalar FirstObs = 1
scalar LastObs = WindowLen
#Out of Sample Forecasting
matrix OOSMatrix = zeros( DataLen - WindowLen, 1)
loop ForecastPeriod = LastObs + 1..DataLen - 1 --quiet
smpl FirstObs LastObs # set data range
# VECM pure with 6 lags
#vecm 7 1 AllHigh AllLow --quiet
# VECM with 6 lags and changes in O, C and daily returns
vecm 7 1 AllHigh AllLow; d_AllOpen d_AllOpen(-1) d_AllOpen(-2) d_AllOpen(-3) d_AllOpen(-4) d_AllOpen(-5) d_AllClose(-1) d_AllClose(-2) ret(-1)
fcast (LastObs+1) (LastObs+1) --quiet
OOSMatrix[ForecastPeriod - WindowLen] = $fcast[1] - $fcast[2]
FirstObs = FirstObs + 1
LastObs = LastObs + 1
endloop
12 years, 9 months
Problems using --robust-hac option within a loop
by Artur Tarassow
There seems to be a bug using the --robust-hac option within a loop, as
can be seen using the example below.
I run current CVS on linux.
----------
open denmark
var 2 LRM LRY --robust-hac
#Robust(-hac) option without exogenous
loop for i=1..1
var $i LRM LRY --robust-hac
endloop
loop for i=1..1
var $i LRM LRY --robust
endloop
-------------------
The error message is : "Invalid option '--robust-hac'"
Best,
Artur
12 years, 9 months
Scalar to series (or Scalars in a dataset) ?
by Bulent Erdemir
Hi,
I'm trying to run multiple OLS's over many data sets and try to figure out
the best R square. Therefore, in a loop, I want to issue ols command
multiple times and store the r-square for each command result in a dataset.
Later I'll sort this dataset and see the max R-square and the associated
dataset .
Following a similar pattern in Lee C. Adkins' book, "Using gretl for
Principles of Econometrics, 3rd Edition", I tried to use the store command
like in the example in the book, on page 30 (pdf page 44), below:
#Monte Carlo
open "c:\Program Files\gretl\data\poe\food.gdt"
set seed 3213789
loop 100 -- progressive
genr u = 88*normal()
genr y1 = 80 + 10*x + u
ols y1 const x
genr b1 = $coeff(const)
genr b2 = $coeff(x)
print b1 b2
store coeff.gdt b1 b2
endloop
I applied this method to my script however the store command wouldn't work
resulting in an error like "is not the name of a series".
I checked the source to see what I'm missing but it seems store command on
accept series data, not scalars:
if (!ok && cmd->err == 0) {
if (gretl_is_scalar(s) || gretl_is_matrix(s)) {
gretl_errmsg_sprintf(_("'%s' is not the name of a series"), s);
cmd->err = E_DATATYPE;
} else {
gretl_errmsg_sprintf(_("'%s' is not the name of a variable"), s);
cmd->err = E_UNKVAR;
}
http://gretl.sourcearchive.com/documentation/1.9.6-1/interact_8c_source.html
Some recommendations on previous posts don't work for me either. Like
outfile. http://lists.wfu.edu/pipermail/gretl-users/2009-June/003339.html
Since the book has such an example, I conclude that store command
used to accept the scalars to set in a series, but later this
functionality was removed.
So, any help is appreciated. How can I treat a set of scalars like a
series in order to run statistical operators on (like max, min, avg,
and more) ?
Best regards,
Bulent Erdemir
12 years, 9 months
Access to the Doornik-Hansen test results is not possible
by Artur Tarassow
Hey guys,
After the estimation of a VAR, I would like to to access the
test-statistic and the corresponding p-value of the Doornik-Hansen test.
But it seems that this is not possible at the moment (at least on
current CVS, Linux) which is not really consistent since it works for
the other usual tests (--autocorr etc.).
Best,
Artur
12 years, 9 months
Scalars sub menu item in View menu
by Bulent Erdemir
Hi,
Gretl users guide page 77, section 11.3 mentions a Sub Menu item "Scalar"
in View menu, however, can't find it in the product. It's supposed to be
used to inspect the values of scalars. Is this feature removed or moved to
somewhere else ?
Best regards,
Bulent Erdemir
12 years, 9 months
Re: [Gretl-users] Data problem
by clarodina clarodina
HI Allin,
There are 1000 rows on the csv file. The program does not allow date not
conforming to the calendar? Atlernative ways to retain the existing date
without restructuring? Tks
12 years, 9 months