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
11 years, 10 months
Bug-hunting: Syntax highlighting
by Henrique Andrade
Dear Allin,
Please take a look into the pdf files attached. As one can see, there's
something wrong with the "colorido.pdf" file (lines between 73 and 197
weren't printed out in Windows Vista).
Best regards, Henrique
*Henrique*
<http://www.ufrgs.br/ppge>
12 years, 11 months
skewness and kurtosis
by Annaert Jan
I know there are functions to compute the mean, median, minimum, maximum and standard deviation for a series. I also know that using the summary command, skewness and excess-kurtosis are also computed. Is there an easy way to capture these last two statistics (I need them for further processing)? Of course, I could write a short function to do this, but as they are already available in Gretl in the summary command…
Thanks,
Jan Annaert
UNIVERSITEITANTWERPEN | Faculty of Applied Economics (TEW) | Dept. Accounting & Finance
Room S.B.335 | Prinsstraat 13 | B-2000 Antwerp | Belgium
Phone +32 32654163 |Fax +32 32654064
12 years, 11 months
Support to "xlsx" files
by Henrique Andrade
Dear Gretl developers,
I would like to make a simple suggestion that possibly requires a not so
easy/simple solution (in terms of coding effort): Add to Gretl support to
.xlsx files.
Best regards,
*Henrique Andrade*
<http://www.ufrgs.br/ppge>
12 years, 11 months
a rather naive question on time-consuming tasks ?
by artur bala
Hello,
In comparing the following scripts, the matrix operations are much more
time-consuming tasks. Is such a behaviour normal ? I was under the
understanding that handling matrices is quicker than operations on
series. :-[
cheers,
artur
nulldata 10000
series x = normal()
series example = 0
loop for i = 1..$nobs --quiet
example[i] = x[i]
endloop
matrix example2 = zeros($nobs,1)
loop for i = 1..$nobs --quiet
example2[i,1] = x[i]
endloop
--
Artur BALA
development economist, consultant
phone: +216 22 99 73 44
skype: artur.bala.tn
email: artur.bala.tn(a)gmail.com
*********************************
12 years, 12 months
bug-hunting time
by Allin Cottrell
Hello all,
We're planning to release gretl 1.9.6 before long -- probably a
couple of weeks from now -- and in the meantime we'd much appreciate
it if you could help us hunt down bugs, so that we can make the best
possible release.
If you have old gretl scripts to hand, please try running them and
check that they still work. And if you have a record of results,
please check that the current results agree with the old ones.
Also -- since checking the gretl GUI for breakage is not so easy as
checking scripts -- please see if you can find time to do things
using the graphical interface and look out for anything wrong.
Send your reports of bugs to this list, or use the bug-tracker at
Sourceforge if you prefer:
http://sourceforge.net/tracker/?group_id=36234&atid=416803
For now, however, please hold back on feature requests -- we're
focused on finding bugs.
Please bear in mind a couple of important points:
1) Your reports will be much more valuable if you're using gretl
that you have build yourself from current CVS, or else the current
snapshot for MS Windows
http://gretl.sourceforge.net/win32/
or Mac OS X.
http://gretl.sourceforge.net/osx.html
Many bugs in the last release (gretl 1.9.5) have already been fixed.
See http://gretl.sourceforge.net/ChangeLog.html .
2) Some older gretl scripts will not work because the scripts
thenselves contain bugs. Current gretl catches (for example) the
syntax error of writing
scalar x = 2*(3 + 4)/y)
which has an extraneous trailing ')'. This was fixed just today
(2011-09-04). I was surprised at how many scripts in my collection
exemplified this error.
Thanks!
Allin Cottrell
12 years, 12 months
fixes for contributed .gfn function packages
by Allin Cottrell
In preparation for the gretl 1.9.6 release I've been checking
all the contributed function packages on the gretl server, and
have corrected a few errors or not-quite-right things in the
following packages.
DST_test.gfn: fix the include path for the .gfn file in the
sample script; remove bad URL from help.
growth.gfn: allow data periodicity other than annual.
HoltWinters.gfn: delete a stray ";"
ModRS_test.gfn: supply a working sample script.
moran.gfn: make the dataset available for the sample script.
SETAR.gfn: make the dataset available for the sample script.
sols.gfn: fix a list definition.
summary_ts.gfn: fix a list definition.
VSG_test.gfn: correct the sample script.
--
Allin Cottrell
Department of Economics
Wake Forest University, NC
13 years
Min search function
by Giuseppe Vittucci
Hi,
I and my colleague are writing a function in gretl to estimate Panel
Smooth Transition Regression (PSTR) models and make the related
diagnostic tests:
http://ideas.repec.org/p/uts/rpaper/165.html
http://ideas.repec.org/a/bla/obuest/v68y2006is1p797-812.html
We have already implemented the Taylor expansion-based linearity tests
(and partly the Hansen's version of the test - we are still working on
it).
Now we are trying to make a function to estimate the parameters of PSTR
models.
The problem is that such models are estimated minimizing the
concentrated sum of squared residuals (see for instance Eq. 11 Pag. 7 of
the first paper cited above).
I need a command in gretl to find a (constrained) minimum of this
function.
Given the non linear parameters gamma and c, this function must
calculate the FE panel coefficients and return the SSR.
I thought I could use the mle command with the related log-L:
Log-L = - n/2(ln SSR/n + const)
where SSR could have been the output of the function
The problem is that such function must have vectors as arguments: gamma
and c are vectors whose dimension can change, since they depend on the
number of regimes and location parameters, in turn determined by the
tests or the researcher.
So, it seems quite problematic to adapt the mle command.
In the Matlab code we are currently using for the estimates, the command
FMINSEARCH() has been used for the purpose.
Is there anything like this command in gretl?
After all, gretl is actually able to compute constrained/uncontrained
min/max...
If there is nothing like this in gretl, which is the best way to
circumvent the problem?
Is it better to call R or Octave from gretl?
And what is a good way to do this?
Thanks a lot
Giuseppe
13 years
defining a list in a script
by Allin Cottrell
In the development phase between gretl 1.9.5 and the soon to be
released gretl 1.9.6 we have tightened up on some aspects of
scripting syntax. (The intent is to avoid obscure errors.)
One point has already been noted: we no longer accept stray
semicolons at the end of lines.
Here's another: if you're defining a new variable of type "list" in
a script, you must use the type-name, for example
list L = x1 x2 x3
(as specified in the Gretl User's Guide). If you try to make L a
list implicitly, as in
L = x1 x2 x3
You'll get a syntax error. (But if "L" is already the name of a list
at the time the above command is issued, that's OK.)
This is because the syntax whereby a space between terms means
list-concatenation of series is very special, and we want to allow
it only if we know in advance that the left-hand side variable in a
gretl formula is supposed to be a list.
Allin Cottrell
13 years
Cointegration test menu not visible in gretl in Ubuntu
by maurizio spadaccino
Hi, I am quite new to Ubuntu so I apologize for any kind of dumb
questions I might ask in this post. However, I've been using gretl on my
prevoius OS (Windows XP) and after a long procedure that allowed me to
install a working version of gretl in Ubuntu I noticed that it would not
feature menu items related to VECM and Cointegration Test functions,
whilst still having commands such es coint2 available via command line.
In both OS i use version 1.9.5. After featuring launch problems from the
UBUNTU software center (segmentation fault) I downloaded first the jar
available in debian list, version 1.9.5, here
http://packages.debian.org/wheezy/i386/gretl/download
and then installed several other packages that would seem to be required
(such as fft tools which I can't remember right now, unfortunately
now...)
Good news is that I now can run gretl in my Ubuntu OS, bad news is I
don't see those cointegration menus which I need.
I thus tried to install the windows version via Wine. it works fine and
shows all the menus, including the ones I need about Johansen test.
Versions are the same (1.9.5) the only difference being that the Windows
version, in its "about" window, has also the name "cvs" attached to the
number of version, whilst the Ubuntu one hasn't.
Do you think there's a way I can try to get the same menu items in the
native ubuntu version of the software?
Thanks in advance
Maurizio
13 years