Where to get examples of Gretl scripts for different types of analysis?
Prof. Carlos A. S. de Andrade
LAPEA - Laboratório de Pesquisa em Economia Aplicada e Engenharia de
Universidade Federal de Campina Grande.
Centro de Humanidades
Unidade Acadêmica de Economia
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
> 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.
garch 1 1 ; Y
series e = $uhat
series h = $h
dataset addobs 10
a0 = $coeff
a1 = $coeff
b1 = $coeff
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
Dear gretl programmers,
I just found out that it is not possible to apply the boxplot command to
vectors/matrices. Would it be possible to activate this feature? This would
also increase the consistency, as it is already possible to use the gnuplot
command for matrices. Maybe one can use a similiar syntax as for the
boxplot 1 2 3 --matrix=test --output=display
Additionally, in the case that columns are named by 'colnames' before, it
would be helpful to plot these strings as well.
I hope this is not to demanding.
I think that this discussion could be of interest for the community.
I wrote last year (
about the creation of a Gretl mode for ESS
<http://ess.r-project.org/>(there is already a R, Stata and SAS mode)
but didn't ask directly to the
This year, I asked them directly and they seems open and I think that It
will be a great opportunity for Gretl to reach another type of users
But if you have additional information (community size, relevance to create
this mode, etc) to help in this process it'll be great
---------- Forwarded message ----------
From: Vitalie Spinu <spinuvit(a)gmail.com>
Date: Sun, Sep 30, 2012 at 10:00 PM
Subject: Re: [ESS] Gretl mode for ESS
To: ahmadou dicko <dicko.ahmadou(a)gmail.com>
>> ahmadou dicko <dicko.ahmadou(a)gmail.com>
>> on Sun, 30 Sep 2012 13:04:40 +0000 wrote:
> Hi everyone,
> I would like to know if adding a GRETL <http://gretl.sourceforge.net/>
> to ESS is planned ?
I have never heard of gretl. How big is the community? And how does it
compare to R, ox and eviews?
> There's already a basic gretl
> but it lacks several features availables in ESS R-mode (sending
> command line, buffer, autocompletion, etc)
It's not that difficult to add a new interaction mode to ESS. The main
problem is not with adding a mode, but rather with maintaining it latter
I can look into it, but not earlier than in a couple of months time.
> So my question is if it's not planned, where to start ? (I would like to
> help even if my elisp programming skillz is weak)
You can look into it yourself. Sources for inspiration are ess-julia.el,
which you probably should start with, and also ess-r-d.el for a more
complete picture. Once the editing mode is there, the main step is to
construct ess-gretl-customize-alist with all the defaults needed for the
interaction with the subprocess, and then write 'gretl function for starting
I just noticed the new (?) function diagcat() with the following help text:
"Returns the direct sum of A and B, that is a block-diagonal matrix
holding A in its north-west corner and B in its south-east corner. "
Why would that be a _sum_?
Also, what happens if A and B are not square? (I know, I could just try
that out, but too lazy, and that wouldn't necessarily answer what's
intended as a result.)
And while I'm at it: I also noticed trimr() which trims rows. Don't know
whether that's new, but why introduce a special function for this
operation, couldn't it always be easily done by indexing, as in
I'm very new with the Gretl and I pretend to make a routine where it is
included a conjuncture analysis with signal extractions through TRAMO/SEATS
(no X12-ARIMA or X13). Is there any program already written for that?
Dear Gretl Community,
I would like to know how can I remove the spaces before a specific
character in a string. Please take a look at my example:
string s1a = " @Gretl is great!"
string s2a = " @Gretl is really great!"
string s1b = strsub(s1a, " @", "")
string s2b = strsub(s2a, " @", "")
I need to remove the blank spaces before the "@" no matter how many blank
spaces I have. Does anyone have a suggestion?
Thanks in advance,
I still have a simple coding question...
So essentially, I have a table with 20 columns and 6000 rows. Each row
represents a volatilty value for a specific time and I have this data for
~20 stocks in my specific universe. My question is, how do I create a loop
in GRETL where I run the Engle-Granger test on all possible permutations
for each Column (each stock name) and output a column with each pair (for
example Column A and Column B) and the level of co-integration (1- pvalue).
Ultimately, I would like to be able to see which combination (of stock
volatilities) are the most cointegrated.
Thanks again and I really hope to hear from you soon!
Dear gretl users,
I want to estimate a dynamic factor model and was wondering whether
somebody here in the list has already done such an exercise. I would
appreciate it if you could provide a small code snippet just to get an
intuition how one could implement this in gretl.
At the moment I using STATA for this, but I would favor to use gretl of
gretl successfully imported excel files with data for me, where to my
amazement the first column which contained the definitions of the
categories was automatically imported as "observation markers" (in
gretl-speak). We're talking about histogram data here, i.e. the
categories are ranges and the data values are the (absolute) number of
My question: Is it possible to make these observation markers appear as
tick labels on the x-axis, when I do a plot of my variable against the
index variable to get the visual shape of the histogram?
Hope I made myself clear here.