Hello, continuing
the “Rolling estimate” topic…
I’m studying
the command fcast and I see that it can be used in rolling
mode just for OLS estimation models. Suppose I want to estimate a Logit model
on a rolling sample of 48 observations over 1057:
smpl
full
smpl
1 48
loop
for i = 1..1057
logit
Binary const ld_Close_1 –-p-values
smpl
+1 +1
endloop
This gives me 2 * (1057
– 48) coefficients, which are “const” and “ld_Close_1”.
Now I want to make a forecast using the same rolling window. I try this one:
smpl full
smpl
1 48
loop
for i = 1..1057
fcast
i --static
smpl
+1 +1
endloop
But it doesn’t
work as I expected. Does anyone know how to produce an output like the GUI one,
but using the rolling sample?
Oscar
Da: gretl-users-bounces@lists.wfu.edu
[mailto:gretl-users-bounces@lists.wfu.edu] Per
conto di Leon Unger
Inviato: Friday, 27 May 2011 6:11
PM
A: Gretl list
Oggetto: Re: [Gretl-users] R: R:
Rolling parameter estimate
Am 27.05.2011 16:41, schrieb Oscar Soppelsa:
I want to
express my congratulations to Professor A. Cottrell and Professor R. Lucchetti
for the awesome gretl software. I'm studying the manual and it's impressive.
Indeed!
I have
written this code in order to estimate an ARMA(1,1) model on I(0) time series using a moving window
which uses only the last 20 values from the time series, "forgetting"
gradually all the past information older than last 20 values.
The code (n = 1057):
smpl 1 20
loop for i =
1..1057
arima 1 0 1 ; ld_Close
smpl +1 +1
endloop
Now I will
try to create two new variables which are the AR(1) and MA(1) coefficients. Do
you suggest me to use genr to create these variables? Does the command
genr c = $coeff
could
allow me to create such a time series of coefficients?
smpl full
series AR = NA
series MA = NA
smpl 1 20
loop for i = 1..1057 --quiet
catch arima 1 0 1 ; ld_close --quiet
if !err
AR[19+i] = $coeff[2]
MA[19+i] = $coeff[3]
endif
smpl +1 +1
endloop
smpl full
This code gives you the estimates you want if there are 20 observations
included in the sample.
Thank you,
Oscar
-----Messaggio originale-----
Da: gretl-users-bounces@lists.wfu.edu
[mailto:gretl-users-bounces@lists.wfu.edu]
Per conto di Allin Cottrell
Inviato: Thursday, 26 May 2011 5:38 PM
A: Gretl list
Oggetto: Re: [Gretl-users] R: Rolling parameter estimate
On Thu, 26 May 2011, Oscar Soppelsa wrote:
> Thank Artur and Riccardo very much for your
answer! I've two question now:
>
> 1. could you explain me the syntax about the
selection of the sample's
> dimension? What does this mean? --->
i=1982:1..1987:3
One standard form of loop in gretl uses the
construction
loop i=1..10
which should be self-explanatory (but is also
explained in the
manual). The variant above uses the convenience
functionality of
representing integer observations numbers as dates (in
this case,
quarterly dates).
> 2. After the rolling parameters estimation, how
can I print on the monitor a
> vertical array whose elements are coefficients,
std. errors, z, p-values
> etc.? I would need to export this array in Excel,
for example.
Regression coefficients and standard errors are
accessible in
matrix form as $coeff and $stderr, after estimating a
model.
z-scores and p-values can easily be computed -- see
the pvalue()
function. Matrices can be concatenated and reshaped at
will, see
the chapter on matrices in the User's Guide. They can
also be
printed in whatever form is appropriate - see the
"printf"
command.
Allin Cottrell
_______________________________________________
Gretl-users mailing list
http://lists.wfu.edu/mailman/listinfo/gretl-users
==============================
DISCLAIMER:
This e-mail is for the sole use of the intended recipient and any file
transmitted with it may contain material that is confidential and privileged.
If you are not the intended recipient of this e-mail, please do not read this
e-mail and delete this message and any file attached from your system and then
notify us immediately by reply e-mail or by telephone. You should not copy or
use this message and any file attached for any purpose, disclose the contents
of the same to any other person or forward them without express permission by
us. Considering the means of transmission, we do not undertake any liability
with respect to the secrecy and confidentiality of the information contained in
this e-mail and in its attachments.
Il presente messaggio di posta elettronica e' ad esclusivo utilizzo del
destinatario indicato in indirizzo e gli eventuali documenti allegati
potrebbero avere carattere riservato. Qualora non foste il destinatario del
presente messaggio Vi preghiamo non leggerlo, di cancellarlo dal Vostro sistema
assieme ad ogni documento ad esso allegato e di volerci avvertire
immediatamente tramite posta elettronica o telefonicamente. E' vietata la
duplicazione o l'utilizzo per qualunque fine del presente messaggio e di ogni
documento ad esso allegato cosi' come la relativa divulgazione, distribuzione o
inoltro a terzi senza l'espressa autorizzazione del mittente. Il mittente, in
ragione del mezzo di trasmissione utilizzato, non assume alcuna responsabilita'
in merito alla segretezza e riservatezza delle informazioni contenute nel
presente messaggio e nei relativi allegati.
==============================
_______________________________________________
Gretl-users mailing list
Gretl-users@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users