Re: [Gretl-users] GARCH, Forecasting
by Allin Cottrell

On Mon, 17 Jan 2011, [ISO-8859-1] Alejandro Mosi�o wrote:
> Maybe i was not too much specific last time:
>
> I have a variable "y" that follows a GARCH(1,1) process. Then, i Gretl i
> type:
>
> garch 1 1 ; y const
>
> Then i got the result and forecasting the out-of-sample values of y can
> be done in the usual way. However, i'm interested in forecasting the
> out-of-sample variance. I don't know if such a function exists in Gretl.
There is no built-in function to do this, but you can compute a
one-step ahead forecast of the variance from the model data, as
hown in the following example script.
<script>
open b-g.gdt
garch 1 1 ; Y
series e = $uhat
series h = $h
dataset addobs 10
a0 = $coeff[2]
a1 = $coeff[3]
b1 = $coeff[4]
series hfc = h
# set future errors to their expectation
e = misszero(e)
# forecast the variance
hfc = a0 + a1 * e(-1)^2 + b1 * hfc(-1)
smpl 1970 ;
print e h hfc --byobs
</script>
Allin Cottrell
8 years

Fixed effects forecast
by Ricardo Gonçalves Silva

Hi,
Can Gretl forecast 1 to 3 periods ahead an estimated panel data(fixed-effects with no iterations) model?
HTH
RIck
9 years, 3 months

Paper advocating open source software and gretl
by Talha Yalta

Dear gretl users:
You might be interested to hear about my new paper entitled "Should
Economists Use Open Source Software for Doing Research?" published
this month in Computational Economics. The paper investigates
econometric software reliability and advocates the use of open source
software by taking gretl as a case study and showing how responsive
and transparent its development process is. I think many people here
might find it an interesting read.
More information and the download link is available here:
http://ideas.repec.org/a/kap/compec/v35y2010i4p371-394.html
I can send a working paper version if you do not have access to the above.
Cheers
A. Talha Yalta
--
“Remember not only to say the right thing in the right place, but far
more difficult still, to leave unsaid the wrong thing at the tempting
moment.” - Benjamin Franklin (1706-1790)
--
9 years, 9 months

MacKinnon, Haug, and Michelis (1999) critical values
by Leon Unger

Hi there,
I've got a question concering the MacKinnon, Haug, and Michelis (1999)
critical values in VECMs.
At University I (have to) work with EViews and after performing a
Johansen Cointergrating Test including an I(0) exogenous variable.
However, I wonder whether the test is biased towards finding a CI vector
when including this variable. Hence I looked up in the object reference
and found:
"Note that the output for cointegration tests displays p-values for the
rank test statistics.These p-values are computed using the response
surface coefficients as estimated in MacKinnon, Haug, and Michelis
(1999). The 0.05 critical values are also based on the response surface
coefficients from MacKinnon-Haug-Michelis. Note: the reported critical
values assume no exogenous variables other than an intercept and trend."
Does anyone know, whether there exist critical values including an I(0)
variable different from an intercept and trend?!
Best
Pindar
9 years, 9 months

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

On Mon, 31 Jan 2011, Leon Unger wrote:
> In terms of importing data via ODBC I've got another general question
> myself:
> obs-format combinded with string (%s) does not work, or to be
> precise, GRETL
> crashes immediately! Could someone provide an example for such
> string indices?
The conversion "%s" in an obs-format string requires that the
corresponding variable from the database is of string type. For
example:
string Q = "SELECT country,year,y FROM FooBase"
data y obs-format="%s:%d" query=Q --odbc
This should work if the "country" variable contains string
country-codes such as "FRA", "GER", etc., and the year variable
contains years as integers:
GER:1990 123.5
GER:1991 127.6
This assumes that the pre-existing gretl dataset has observation
strings on the pattern shown above.
Allin Cottrell
9 years, 10 months

Re: [Gretl-users] ADF test inside a loop
by Allin Cottrell

On Mon, 31 Jan 2011, Henrique Andrade wrote:
> I'm trying to perform several ADF tests and save the results (statistic +
> p-value) inside a matrix. Please take a look at my script:
>
> <script>
> open australia.gdt
> list Variables = lpus iau2 lpau
> scalar T = nelem(Variables)
>
> scalar lag = int(12*($nobs/100)^(1/4))
>
> matrix ADF = zeros(nelem(Variables),2)
> colnames(ADF, "estatistica p-valor")
> rownames(ADF, "lpus iau2 lpau")
>
> loop foreach i Variables
> loop j=1..T
> adf lag $i --c --test-down
> matrix ADF[$j,] = $test ~ $pvalue
> endloop
> endloop
Why are you using two loops? Conceptually, there's only one:
loop foreach i Variables -q
adf lag $i --c --test-down
ADF[i,] = $test ~ $pvalue
endloop
You should use "$i" (and the like) _only_ when you need string
substitution (as in the adf command): otherwise use plain "i"
(as in matrix indexation) to get the numerical value.
Allin Cottrell
9 years, 10 months

Re: [Gretl-users] Nonlinear switching regression vs Loop constructs
by Allin Cottrell

On Fri, 28 Jan 2011, GREg Ory wrote:
> I need some tips on estimating panel data using nonlinear switching
> regression technique. AFAIK there are two ways of solving it.
I've had one more go at this problem, because it seems like quite
a nice showcase for what one can now do with gretl scripting. I'm
attaching a script which combines the grid-search approach with
NLS estimation. That is, I first do the grid-search, over what
you stated were acceptable values for mu and sigma, then I
initialize NLS using the best values from the grid. The script
includes a "switch" to turn fixed-effects on or off.
What I'm getting from this (with fixed effects on) is:
grid-search
(mu,sigma) = (0.40, 0.20); SSR = 25.6531, R^2 = 0.803620
NLS (unconstrained)
(mu,sigma) = (0.18, 0.03); SSR = 25.4212, R^2 = 0.806201
That is, NLS finds a slightly better fit with an "out of bounds"
mu value. NLS also shows that the sigma estimate is statistically
indistinguishable from zero, which suggests that the logistic term
may not be appropriate.
Allin Cottrell
9 years, 10 months

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

On Mon, 31 Jan 2011, [iso-8859-1] RENIER M�lanie wrote:
> I have one problem when trying to import data via odbc.
> It connect to the server but does not achieve to load the data.
> I have the following message error:
>
> ? open dsn=inf1 --odbc
> Connected to ODBC data source 'inf1'
> ? data x y query="select code,denomination from usig.co_etciv" --odbc
>
> Error executing script: halting
> > data x y query="select code,denomination from usig.co_etciv" -odbc
The "data" command looks well-formed in itself: are you sure that
the names "code", "denomination" and "usig.co_etciv" are correct?
(including uppercase/lowecase correctness if that's applicable)
You may get some more detail on the standard error output. On
Windows, that would mean starting the program with the --debug
flag:
gretlw32.exe --debug
That will open a console window, which may display some additional
messages related to SQL.
Allin Cottrell
9 years, 10 months

ADF test inside a loop
by Henrique Andrade

Dear Gretl Community,
I'm trying to perform several ADF tests and save the results (statistic +
p-value) inside a matrix. Please take a look at my script:
<script>
open australia.gdt
list Variables = lpus iau2 lpau
scalar T = nelem(Variables)
scalar lag = int(12*($nobs/100)^(1/4))
matrix ADF = zeros(nelem(Variables),2)
colnames(ADF, "estatistica p-valor")
rownames(ADF, "lpus iau2 lpau")
loop foreach i Variables
loop j=1..T
adf lag $i --c --test-down
matrix ADF[$j,] = $test ~ $pvalue
endloop
endloop
print ADF
</script>
With that script I get almost all I need. Only the following problems
remain:
(1) The command "rownames" doesn't work;
(2) I can´t figure out how to save the test statistic and the associated
p-value (I know I'm overwriting the values inside the loop, but can´t find a
way to avoid that).
Best regards,
--
*Henrique C. de Andrade*
Doutorando em Economia Aplicada
Universidade Federal do Rio Grande do Sul
www.ufrgs.br/ppge
9 years, 10 months