Examples of Gretl scripts
by Carlos Andrade

Dear All,
Where to get examples of Gretl scripts for different types of analysis?
--
Atenciosamente,
Prof. Carlos A. S. de Andrade
LAPEA - Laboratório de Pesquisa em Economia Aplicada e Engenharia de
Produção
Universidade Federal de Campina Grande.
Centro de Humanidades
Unidade Acadêmica de Economia
8 years

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, 5 months

Upgrading to Windows 7
by Frank Benford

Hello gretl community. I'm running gretl on a Windows XP machine and am
contented. My computer guru suggests that I upgrade to Windows 7, and says
that all of my software will transfer seamlessly. Although I'm sure she's
right about a lot of my software (MS Office, for example), I'd like to be
assured that I'll have no trouble reinstalling gretl. What has been your
experience with an upgrade like this?
If you know, I'd like the same assurances regarding Exp, MatLab, R, and
Maple.
Thanks, Frank Benford
8 years, 10 months

Re: [Gretl-users] Upgrading to Windows 7
by Allin Cottrell

On Wed, 30 May 2012, Frank Benford wrote:
> Hello gretl community. I'm running gretl on a Windows XP machine and am
> contented. My computer guru suggests that I upgrade to Windows 7, and says
> that all of my software will transfer seamlessly. Although I'm sure she's
> right about a lot of my software (MS Office, for example), I'd like to be
> assured that I'll have no trouble reinstalling gretl. What has been your
> experience with an upgrade like this?
There shouldn't be any problem with current gretl on Windows 7.
We're going to release gretl 1.9.9 shortly; if you want to reinstall
before then I would recommend using the current "snapshot" rather
than gretl 1.9.8. (The snapshot is sometimes unstable, but right now
it includes several bug fixes and -- to my knowledge -- nothing
that's likely to cause problems.)
> If you know, I'd like the same assurances regarding Exp, MatLab, R, and
> Maple.
R should be fine; no idea about the others.
Allin Cottrell
8 years, 10 months

matrix no positive definite
by mastro2387＠tiscali.it

Dear All,
I have a problem with running a VAR: i selected three
endogenous variables and one dummy as exogenous, 8 lags chosen by lag
selection option, with constant, trend and robust error options
selected, but gretl is saying to me matrix is no positive definite: how
can I sort this issue out?
Thanks
Regards
Mirko
----Messaggio
originale----
Da: paolo.chirico(a)unito.it
Data: 30/05/2012 10.57
A:
"Gretl list"<gretl-users(a)lists.wfu.edu>
Ogg: Re: [Gretl-users] problem
with kalman filter
Il 29/05/2012 18.39, Allin Cottrell ha scritto:
>
On Tue, 29 May 2012, Paolo Chirico wrote:
>
>> I have run the following
script for local linear model with quarterly
>> seasonality:
> [snip]
>
> you define a matrix Q:
>
> matrix Q = {s1^2, 0, 0, 0, 0; \
> 0, s2^2, 0, 0, 0; \
> 0, 0, s3^2, 0, 0; \
> 0, 0, 0, 0, 0; \
> 0, 0, 0, 0, 0}
>
>
Then you do:
>
>> kalman
>> obsy y
>> obsymat z
>> statemat
T
>> obsvar r
>> statevar Q
>> end kalman --diffuse
>>
>> mle
ll = ERR ? NA : $kalman_llt
>> ERR = kfilter()
>> params r s1
s2 s3
>> end mle
> mle is spinning its wheels: you haven't provided any
means of
> updating your Q matrix based on the current values of s1, s2
and s3.
> You need to insert, just before the call to kfilter()
>
> Q[1,1] = s1^2
> Q[2,2] = s2^2
> Q[3,3] = s3^2
>
> (There may be other problems but that's the most obvious one.)
>
>
Allin Cottrell
> _______________________________________________
>
Gretl-users mailing list
> Gretl-users(a)lists.wfu.edu
> http://lists.wfu.
edu/mailman/listinfo/gretl-users
>
>
You are right.
I have corrected
the script and now it' ok.
Thanks
Paolo
--
Paolo Chirico
Ricercatore e Professore Aggregato
di Statistica Economica
Università
di Torino
Via Maria Vittoria, 38
10123 Torino (Italy)
_______________________________________________
Gretl-users mailing
list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.
edu/mailman/listinfo/gretl-users
Invita i tuoi amici e Tiscali ti premia! Il consiglio di un amico vale più di uno spot in TV. Per ogni nuovo abbonato 30 € di premio per te e per lui! Un amico al mese e parli e navighi sempre gratis: http://freelosophy.tiscali.it/
8 years, 10 months

Monte Carlo
by tamerlan kabaloty

Please give me some advices how to use in gretl the Monte Carlo
method. I need to generate returns of the investment portfolio to
maximize the return on that portfolio. Give me please some scripts.
Thanks
--
*С уважением,*
*Тамерлан Кабалоев*
8 years, 10 months

problem with kalman filter
by Paolo Chirico

I have run the following script for local linear model with quarterly
seasonality:
scalar r = 10
scalar s1=1
scalar s2=1
scalar s3=1
matrix z = {1; 0; 1; 0; 0}
matrix Q = {s1^2, 0, 0, 0, 0; 0, s2^2, 0, 0,
0; 0, 0, s3^2, 0, 0; 0, 0, 0, 0, 0;
0, 0, 0, 0, 0}
matrix T = {1, 1, 0, 0, 0; 0, 1, 0, 0, 0;
0, 0, -1, -1, -1; 0, 0, 1, 0, 0; 0,
0, 0, 1, 0}
kalman
obsy y
obsymat z
statemat T
obsvar r
statevar Q
end kalman --diffuse
mle ll = ERR ? NA : $kalman_llt
ERR = kfilter()
params r s1 s2 s3
end mle
The model is a local linear model with quarterly seasonal.
But, I get the following error: *failed to invert OPG matrix GG'*
Where is the error? In the initial values of r, s1,..., in the script,
or in kfilter()?
Best regards,
Paolo
--
Paolo Chirico
Statistica Economica
Dipartimento di Economia
"S. Cognetti de Martiis"
Università di Torino
8 years, 10 months

interprating Ljung-Box Q-Test
by mastro2387＠tiscali.it

Hi everybody,
I have a problem to interpret a Ljung-Box Q-test results;
is it the usual staff? namely if the P(chi-square) is less than 5% we
have to accept i.i.d assumption?
Here is the output of the test:
Equation 1:
Ljung-Box Q' = 57.8787 with p-value = P(Chi-square(5) >
57.8787) = 3.33e-011
Equation 2:
Ljung-Box Q' = 54.5922 with p-value =
P(Chi-square(5) > 54.5922) = 1.58e-010
Thanks for help
Regards,
Mirko
Invita i tuoi amici e Tiscali ti premia! Il consiglio di un amico vale più di uno spot in TV. Per ogni nuovo abbonato 30 € di premio per te e per lui! Un amico al mese e parli e navighi sempre gratis: http://freelosophy.tiscali.it/
8 years, 10 months

save the graphpage using a command
by Artur Tarassow

Dear gretl list,
is it possible to save a 'graphpage' by a command? I compiled a bunch of
figures (each includes more than one line to plot) and I would like to
plot some of them on a single page (multiplot). The 'graphpg' command is
suitable for this, but only as long as one saves the produced page 'by
hand' each time. If one wants to save many graphpages, e.g. in a loop,
this is quite time-consuming, and it would make things much easier if
one could save each page as pdf/eps/... by a simple command e.g. like
'graphpg --output=filename.*' or so.
Of course one could use gnuplot for this, but I think it gets a bit more
complicated if one uses strings-chacraters producing figures; but maybe
I am wrong here ;-)
Best,
Artur
8 years, 10 months

problem concerning dummies
by Paolo Caliò

Hello!
I need to create some dummy variables in order to capture all the possible
combinations of a certain set of variables.
For instance, let's assume I have three variables a, b, c.
I need one dummy equal to 1 when all three variables are positive, zero
otherwise.
I need one dummy equal to 1 when all three variables are negative, zero
otherwise.
I need one dummy equal to 1 when a and b are positive and c negative, zero
otherwise.
I need one dummy equal to 1 when a and c are positive and b negative, zero
otherwise.
Etc etc etc...
I would do this in Excel since my database is taken from a csv, but the
actual number of variables is much higher then 3, so it takes a lot of time
to do it manually.
I don't have any idea if it is possible to create these dummies
automatically with some piece of code in GretL, but if it is I would really
really appreciate your help in writing this code.
Thank you very much in advance.
Cheers,
Paolo
8 years, 10 months