gretl 1.7.6rc1
by Allin Cottrell

Current gretl CVS and the Windows snapshot at
http://ricardo.ecn.wfu.edu/pub/gretl/gretl_install.exe
contain release candidate 1 for gretl 1.7.6.
Please note that this version involves a backward-incompatible
change with respect to gretl 1.7.5 and earlier, affecting
user-defined functions that (a) take a named list of variables as
an argument and (b) do things with the list-member variables by
means of a "foreach" loop on the list.
I won't go into the rationale for this change here. Anyone who
wants the details may look at the proceedings on the gretl-devel
list for July, which were mostly taken up with this issue:
http://lists.wfu.edu/pipermail/gretl-devel/2008-July/thread.html
There's also a brief discussion in the chapter of the User's Guide
that deals with user-defined functions. But here's the bottom
line for users:
* If you want to "get hold of" a list-member variable in the
context noted above, you have to use the syntax listname.varname,
where listname is the name of the list in question and varname is
the name of the list member. (This is required only if you're
working with a list that was supplied as a function argument.)
Trivial example: inside a function, creating new variables which
are the cubes of the members of an original list, xlist, where
xlist is an argument to the function.
Old style:
loop foreach i xlist
$i_3 = $i^3
endloop
New style:
loop foreach i xlist
$i_3 = (xlist.$i)^3
endloop
In the new scheme, "$i" gets the name of the list-member variable
alright, but the variable is not "visible" under that name within
the function. So on the right-hand side of the expression that
creates the cubes, we need "(xlist.$i)^3". (Well, actually the
parentheses are not required, but wearing your seatbelt is in
general a good idea.)
Although this may affect quite a large number of existing
functions, we believe the effects are localized and the update
should be trivial. If anyone has a function for which the update
is _not_ trivial, please let us know.
Allin Cottrell.
13 years, 10 months

inconsistency in PCA function
by Rebecca Zhang

Hi,
I got inconsistent results when running PCA using covariance matrix in gretl. Please see attached TSY_curve file for the data used. Please see attached PCA_problem file that illustrated the problem when verified with R.
The result highlighted in yellow is different from R result and appears in consistent with a reduced components result. I appreciate if you can look into it. Thank you.
Regards,
Rebecca
14 years, 3 months

generalized impulse response
by Artur T.

Hello gretl community ;-)
I would like to ask whether there are any plans to incorporate
generalized impulse response functions into VAR analysis; based on the
papers by:
1. Koop, G., Pesaran, M. H. and S. M. Potter (1996), “Impulse Response
Analysis in Nonlinear Multivariate Models”, Journal of Econometrics, 74,
119–147.
and maybe
2. Pesaran, M. H. and Y. Shin (1998), “Generalized Impulse Response
Analysis in Linear Multivariate Models”, Economics Letters, 58, 17–29.)
Or maybe anyone has written some function for it? I have no idea how
difficult it is to implement this feature, but I think it might be
worthy if the programming effort is not too big and the demand for it
sufficient.
Best,
Artur
14 years, 4 months

cross-correlation output for several variables
by Artur T.

Good evening,
I've got a suggestion for improving the cross-correlation output. At the
moment it is only possible to get an output of the result for only two
variables under consideration. Maybe it is worth to implement the
possibility to set a variable x for which the cross-correlation with
several other variables is computed (similar to the multiple scatter
graph idea). The current output format can remain as it is at the
moment; one just could add more columns for the additional variables
under consideration.
Hopefully this is not hard to program and you also like the suggestion.
Best,
Artur
14 years, 6 months

Error message in MLE script
by Caro Landry

Hi!
I've been trying to write an MLE script for a Probit model where the
dependent value can take 3 values, but when I run the script, I get an "Data
types not conformable for operation". What does that mean and how do I fix
it?
mle loglik3 = (yy=1)ln(cnorm(c1-xb2)) + (yy=2)ln(cnorm(c2-xb2) -
cnorm(c1-xb2)) + (yy=3)ln(1 - cnorm(c2-xb2))
scalar c1 = -10
scalar c2 = -10
scalar pb1 = -10
scalar pb2 = -10
series xb2 = pb1*x1 + pb2*x2
params pb1 pb2 c1 c2
end mle
gretl version 1.8.4
Current session: 2010-02-25 16:24
? mle loglik3 = (yy=1)ln(cnorm(c1-xb2)) + (yy=2)ln(cnorm(c2-xb2) - \
cnorm(c1-xb2)) + (yy=3)ln(1 - cnorm(c2-xb2))
? scalar c1 = -10
? scalar c2 = -10
? scalar pb1 = -10
? scalar pb2 = -10
? series xb2 = pb1*x1 + pb2*x2
? params pb1 pb2 c1 c2
? end mle
Data types not conformable for operation
Error executing script: halting
> end mle
14 years, 6 months

Creating new series
by Caro Landry

Hi!
I haven't found any answer to this problem online, and so am hoping that
someone can help me here.
I need to:
a) create a new series that comprises only the positive observation of a
series
b) only use the observations for which the new series are not equal to 0 in
a NLS
How would I go about that?
Thanks in advance for your help!
Caroline Landry
14 years, 6 months

generate a dummy
by Fritsche, Ulrich

Dear all,
I use the "educational attainment and earnings" data set from Dougherty (2007) to explain the idea of a logit (or probit) model in the classroom.
When I moved my files from EViews to gretl, I have difficulties to generate a dummy for the cases where the value for the variable s is larger than a certain threshold (let's say 12) to estimate what Dougherty did with his "GRAD" variable in the book.
I knew how it worked in Eviews but in gretl I thought the following part of the help is relevant:
"A tip regarding dummy variables: Suppose x is coded with values 1, 2, or 3 and you want three dummy variables, d1 = 1 if x = 1, 0 otherwise, d2 = 1 if x = 2, and so on. To create these you can use the commands:
genr d1 = (x=1)
genr d2 = (x=2)
genr d3 = (x=3)"
So I tried "genr dummy = (s>11)"
Did not work out. How can I handle this?
Best, Ulrich
Professor Dr. Ulrich Fritsche
Fachbereich Sozialökonomie
Fakultät Wirtschafts- und Sozialwissenschaften
Universität Hamburg
Von-Melle-Park 9
20146 Hamburg
www.ulrich-fritsche.net
14 years, 6 months

Problem with Kalman Filter
by Marcello Bonassoli

Hi everybody,
I am using Kalman filter to esteem a particular financial model. The problem
is that Gretl cannot complete the maximum likelihood estimation (see Gretl
script below) and report this message:
Sono state usate derivate numeriche
Tolleranza = 1,81899e-012
failed to invert OPG matrix GG'
Errore nell'esecuzione dello script: abbandono
end mle
I cannot understand what is the problem, maybe someone can help me
Thanks
Here is the script:
matrix y={ENI_Return, ENI_OF, Enel_Return, Enel_OF}
/* parameter initalization */
fic = 0.95
fieni = 0.95
fienel = 0.95
b1r = 0
b1o = 0
b2r = 0
b2o = 0
c1r = 0
c1o = 0
c2r = 0
c2o = 0
/* Kalman filter setup */
matrix H = {b1r, b1o, b2r, b2o; c1r, c1o, 0, 0; 0, 0, c2r, c2o}
matrix F = {fic, 0, 0; 0, fieni, 0; 0, 0, fienel}
matrix Q = {1, 0, 0; 0, 1, 0; 0, 0, 1}
matrix A = {-0.0000015464, 0.20765, 0.000011055, 0.010607}
matrix R = {0.00000316057284, 0, 0, 0; 0, 68.26394884, 0, 0; 0, 0,
0.00000264875625, 0; 0, 0, 0, 17.57705625}
kalman
obsy y
obsymat H
statemat F
statevar Q
obsxmat A
obsvar R
end kalman
/* maximum likelihood estimation */
mle logl = ERR ? NA : $kalman_llt
H[1,1] = b1r
H[1,2] = b1o
H[1,3] = b2r
H[1,4] = b2o
H[2,1] = c1r
H[2,2] = c1o
H[3,3] = c2r
H[3,4] = c2o
F[1,1] = fic
F[2,2] = fieni
F[3,3] = fienel
ERR = kfilter()
params fic fieni fienel b1r b1o b2r b2o c1r c1o c2r c2o
end mle
/* return the smoothed estimate of \Unobsrved variables_t */
kalman
obsy y
obsymat H
statemat F
statevar Q
obsxmat A
obsvar R
end kalman --diffuse
series epsilon = ksmooth()
--
Marcello Bonassoli
Politecnico di Milano Graduate student
14 years, 6 months

Loop programming
by Sébastien Rodrigue-Privé

Hi everyones, I'm a new Gretl user and I have a huge "mission" to do with
the program.
First of all, I have 883 times series variable to deflate.
The name of series are I001EX through I999EX, and I001IM through I999IM and
finally I001IMT through I999IMT.
Each of this times series matrix have to be "deflated", divided by an other
time serie namely def_us (the deflator).
I want to program a kind of loop to "genr" all of this times series data
"deflated", an other 883 series.
After this, for all of this new times series variable (883) I have to
regressed in OLS with some explicative variable.
Again I want to create a loop, not to do so 883 times, one by one.
Finally, I want, all my results being exportable in block to an Excel or the
OpenOffice table, once.
This part, I honestly have no clue how to do this things at all, or if it's
at least possible.
Thank you very much
Sebastien
14 years, 6 months

Generating TRUE forcast
by Clive Hudson

At present im still not 100% sure how to produce 100% true forcasts using gretl. Ive been testing using stock data from the sp500 and nasdaq stock index's
the code im using is close_spx is sp500 data close_ndx is nasdaq stock data
loop i=31..2231
smpl $i-30 $i-1
ols close_spx const time close_ndx
fcast $i $i
genr pclose_spx[$i] = $fcast
endloop
im sure there is an error in this code but cant figure it out
regards robert
14 years, 6 months