Current gretl CVS and the Windows snapshot at
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:
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.
loop foreach i xlist
$i_3 = $i^3
loop foreach i xlist
$i_3 = (xlist.$i)^3
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.
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.
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
1. Koop, G., Pesaran, M. H. and S. M. Potter (1996), “Impulse Response
Analysis in Nonlinear Multivariate Models”, Journal of Econometrics, 74,
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
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
Hopefully this is not hard to program and you also like the suggestion.
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
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
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
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
b) only use the observations for which the new series are not equal to 0 in
How would I go about that?
Thanks in advance for your help!
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?
Professor Dr. Ulrich Fritsche
Fakultät Wirtschafts- und Sozialwissenschaften
Hi everyones, I'm a new Gretl user and I have a huge "mission" to do with
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
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
smpl $i-30 $i-1
ols close_spx const time close_ndx
fcast $i $i
genr pclose_spx[$i] = $fcast
im sure there is an error in this code but cant figure it out