Re: [Gretl-users] import data via odbc
by Allin Cottrell

On Fri, 4 Mar 2011, Leon Unger wrote:
> in terms of importing data via odbc I encountered*strange
> behavior *of GRETL if using string labels instead of number
> labels.
Thanks for the report, I'll look into this.
Allin Cottrell
13 years, 7 months

Re: [Gretl-users] import data via odbc
by Allin Cottrell

On Wed, 2 Feb 2011, [iso-8859-1] RENIER M�lanie wrote:
> I found that in fact if GRETL says it connect to the data source
> inf1 in Oracle, it does not stay connected to it! Does somebody
> already encounter this problem?
Here is what gretl actually does when you issue the commands
open ... --odbc
to open an ODBC connection, and
data ... --odbc
to retrieve data from such a connection.
1) In response to the "open" command we record the information you
provide (DSN, username and password) and try an SQLConnect. If the
connection fails, we issue an error message and delete the DSN
information. If the connection succeeds, we close the connection
with SQLDisconnect but retain the good DSN information for use
with the "data" command.
2) In response to the "data" command we see if there is a set of
good, stored DSN information (from a successful "open"), and if
so we use SQLConnect, grab the requested data, then do
SQLDisconnect.
That is, we don't keep the DB connection open indefinitely, rather
we open it on demand based on verified DSN information. And that
information will stay in place for the duration of a gretl
session, unless it is replaced by a further invocation of
"open ... --odbc".
On the SQLConnect there is a login timeout of 5 seconds, which
seems to be fairly standard. If you have a particularly cranky
DBMS that won't authenticate you within 5 seconds, the "open"
and/or "data" commands will fail.
Allin Cottrell
13 years, 7 months

ARIMA(0,0,1)(0,0,1) forecasts
by & $

Hi everyone,
I'm having trouble understanding the way that Gretl computes forecasts for ARIMA(0,0,1)(0,0,1) models. If I generate a random data set and fit this model (using either algorithm) to get the estimates theta_1 and Theta_1, and then generate a forecast, then I would expect the forecast to be computed using the polynomial
1 + theta_1*L + Theta_1*L^4 + theta_1*Theta_1*L^5
p.176 of the manual appears to suggest that this should be the case. However, if I copy the estimates and residuals to a spreadsheet and calculate the same forecast 'manually' I get a different result. Furthermore, after a little experimenting, I have found that if I use the polynomial
1 + theta_1*L + Theta_1*L^4 - theta_1*Theta_1*L^5
I get exactly the same forecast as Gretl. However, I can't see how this can be correct. In particular, this polynomial cannot be written as the product of two factors, which means that it can't be a ARIMA(0,0,1)(0,0,1) model (can it?).
What am I missing here?
Thanks in advance for any help.
Chris.
13 years, 7 months

Re: [Gretl-users] Q-statistic
by Allin Cottrell

On Wed, 2 Mar 2011, Sam Sam wrote:
> I run ARIMA(1,0,1) by conditional maximum likelyhood.
> the residual is :
>
> table1:
> uhat2
> 1980:01
> 1980:02 -5.421687
> 1980:03 -0.506024
> 1980:04 1.867470
> 1980:05 1.698795
>
> I choose the options /Graphs/--/Risidual correlogram/
> output of Residual autocorrelation function shows:
>
> table2:
> LAG ACF PACF Q-stat. [p-value]
>
> 1 0.1567 0.1567 0.1964 [0.658]
> 2 -0.3373 -0.3710 1.5619 [0.458]
> 3 -0.3194 -0.2244 4.0097 [0.260]
>
> I caucualte Q-statistic by the formulation of Ljung-Box statistc from table1,
> but the values I cauculate by myself seem not equal to the values of table2 (0.1964, 1.5619, and 4.0097)
> Maybe I mistake somewhere.
Here is a script that calculates ACF and Q just as gretl does,
using the residuals you got:
<script>
function scalar acf (int k, series y, scalar ybar)
scalar num = 0
scalar den = 0
t1 = $t1
t2 = $t2
loop for (t=t1; t<=t2; t++) --quiet
z = y[t] - ybar
den += z * z
if t - k >= t1
num += z * (y[t-k] - ybar)
endif
endloop
return num / den
end function
function scalar LBQ (series y, int m)
scalar ybar = mean(y)
scalar T = $nobs
scalar LB = 0
# calculate acf up to lag m, cumulating LB
loop for (k=1; k<=m; k++) --quiet
a = acf(k, y, ybar)
LB += a * a / (T - k)
endloop
LB *= T * (T + 2.0)
return LB
end function
nulldata 5
setobs 12 1980:01 --time-series
series uhat2
smpl 1980:02 ;
uhat2 = {-5.421687, -0.506024, 1.867470, 1.698795}'
# do the calculation manually
lb = LBQ(uhat2, 1)
lb = LBQ(uhat2, 2)
lb = LBQ(uhat2, 3)
# compare gretl's built-in function
lb = ljungbox(uhat2, 1)
lb = ljungbox(uhat2, 2)
lb = ljungbox(uhat2, 3)
</script>
Allin Cottrell
13 years, 7 months

Q-statistic
by Sam Sam

Dear all:
I run ARIMA(1,0,1) by conditional maximum likelyhood.
the residual is :
table1:
uhat2
1980:01
1980:02 -5.421687
1980:03 -0.506024
1980:04 1.867470
1980:05 1.698795
I choose the options /Graphs/--/Risidual correlogram/
output of Residual autocorrelation function shows:
table2:
LAG ACF PACF Q-stat. [p-value]
1 0.1567 0.1567 0.1964 [0.658]
2 -0.3373 -0.3710 1.5619 [0.458]
3 -0.3194 -0.2244 4.0097 [0.260]
I caucualte Q-statistic by the formulation of Ljung-Box statistc from table1,
but the values I cauculate by myself seem not equal to the values of table2 (0.1964, 1.5619, and 4.0097)
Maybe I mistake somewhere.
This question puzzles me.
13 years, 7 months

Re: [Gretl-users] gretlw32.exe fails to open - Version 1.9.4.
by Allin Cottrell

On Tue, 1 Mar 2011, Desikan Srinivasan wrote:
> Regards. Thank you for the mails. But my efforts are in vain. I am now
> installed the previous version of Gretl 1.9.3. It is running. I can start
> gretl in"d:\userdata\gretl\gretlw32.exe --debug": but a DOS window opens in
> the background in which I cant read the things displayed.
It's called a console window. You should be able to copy and paste
the text from there. (If I recall correctly you get a menu by
clicking in the top left corner of the box.) If it's too much
bother, OK never mind, but we're probably not going to get gretl
1.9.4 running on Athlon XP without some debugging information.
Allin Cottrell
13 years, 7 months

Re: [Gretl-users] gretlw32.exe fails to open - Version 1.9.4.
by Allin Cottrell

On Mon, 28 Feb 2011, Desikan Srinivasan wrote:
> Greetings and regards. I have installed the
> gretl-1.9.4-no_sse2.exe and tried to run it. But to my surprise
> it fails to run indicating the same error.
OK, thanks for testing. I'm still working on the assumption that
the new random-number generation code is somehow generating
illegal instructions for the athlon. I've now put up a revised
build, gretl-1.9.4-no_sse2a.exe, at
http://sourceforge.net/projects/gretl/files/gretl/1.9.4/
If that still doesn't work, it's possible that there's something
in the updated GTK library stack, packaged with gretl, that is
choking your system; and I can try a build using an older version
of GTK.
But if this version won't start, can I ask you try a debugging run
and see what you get? To start gretl in debugging mode, create a
desktop shortcut item for gretl, but after the path to
gretlw32 add --debug, for example
"c:\program files\gretl\gretlw32.exe" --debug
You should get a console window with some messages that might help
in diagnosing the problem.
Allin Cottrell
13 years, 7 months

Box-Pierce Q statistic
by Sam Sam

Dear all:
Question 1:
Is it Box-Piece Q statistic or Ljung-Box Q statistic in gretl?
Question2:
Q statistic is ditributed as chi-square,
degree of freedom is the numer of lags, or the numer of lags minus the number of parameter estimated?
Thanks a lot
13 years, 7 months

Box-Pierce Q statistic
by Sam Sam

Dear all:
The Q statistic to test if the series is white noise in gretl is Box-Pierce Q statistic, is it ?
But I can not find its formulation in gretl.
Is the formulation of Q statistic the same as the reference of Box & Pierce (1970) ?
Thanks a lot
13 years, 7 months