Where to get examples of Gretl scripts for different types of analysis?
Prof. Carlos A. S. de Andrade
LAPEA - Laboratório de Pesquisa em Economia Aplicada e Engenharia de
Universidade Federal de Campina Grande.
Centro de Humanidades
Unidade Acadêmica de Economia
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
> 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.
garch 1 1 ; Y
series e = $uhat
series h = $h
dataset addobs 10
a0 = $coeff
a1 = $coeff
b1 = $coeff
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
Good Morning all!
I am trying to create a script for recursive EWMA (Exponential Weighted Moving Average) volatilty estimation.
As I am not familiar with gretl syntax language I'm desparetly looking for your help.
The problem is following:
1) First of all I need to identify the first observation of returns series. I've tried to do this by appliying FirstObs function. But that didn't work.
2) then I would like to replicate the ewma formula in order to get the variance of return series.
for that i've seen there is a MOVAVG function. I didn't find any example of syntax in user's guide. How does this work?
I would highly appreciate your help.
Thanks a lot.
I will be out of the office starting 06/23/2012 and will not return until
Hi All, I will be out of the office on PTO from Monday, June 25 through
Friday June 29 , returning to the office on Monday, July 2. If you have
any concerns with Cost Model and other construction economics matters,
please, contact Bradley Njus at 510 625 4595.
I want to start using the libgretl library using Xcode. I have the GRETL
application installed and running on my mac. I could not find the gretl
"include" directory anywhere in GRETL directory tree, I cannot figure out
from where I should start, what else I need to download and install? Can
anyone help me in this regards?
I was playing around and I think I noticed a bug in ARMA prediction, or I
am missing something. You can find the data to replicate here
I am on a recent CVS checkout. gretl 1.9.9. I don't know cvs well enough to
get more information.
It's yearly sunspot activity starting in 1700. I don't know a better way to
demonstrate this, so here it goes. The estimated coefficients of the exact
MLE ARIMA(9,0,0) model with a constant are
The sum of the AR parameters is something like
So the expected level of the process is
mu = 48.3243 * (1 - 0.882703) = 5.6682382
Now if I go to Analysis -> Forecasts. Chose start 1700 and end whatever.
Select the dynamic forecast radio button. You'll see that the first
prediction is 11.2 in 1709. This is fine and expected. The next prediction
is 9.5. This is not expected. If you replace the actual endogenous variable
at 1709 with 11.2 and do the math, you don't get 9.5.
5.6682382 + 11.0 * 0.2524 + 16.0 * -0.0858 + 23.0 * 0.0521 + 36.0 * 0.0091
+ 58.0 * -0.0944 + 29.0 * 0.1504 + 20.0 * -0.1663 + 10.0 * -0.3954 +
11.23057 * 1.1607
This equals 13.24, which is also what I get from other software such as
Stata. There aren't any pre-sample residuals or anything coming in to play,
so I'm not sure how the prediction could be 9.5. Obviously after a time,
the prediction converges to the long run mean, but the initial predictions
don't seem right to me.
Please let me know if anything isn't clear or if I'm being dense.
I have tried the ARIMA command in GRETL with the attached time series data.
The time series is constructed with the below formula ( a- is normal random
z(t) = 0.50 + 0.50*z(t-1) + 0.40*z(t-2) + a(t)-0.25*a(t-1)
with the arima command (arima 2 0 2; 1), for order (2,2) , I am getting the
coefficient std. error z p-value
const 4.96454 0.0275435 180.2 0.0000 ***
phi_1 -0.447238 0.789760 -0.5663 0.5712
phi_2 -0.0272188 0.390533 -0.06970 0.9444
theta_1 0.751567 0.787981 0.9538 0.3402
theta_2 -0.00643631 0.629626 -0.01022 0.9918
The output is not showing the correct coefficient values for model
parameters. I have attached the input data.
Can anyone check the attached dataset and let me know what could be the
I have a problem with running package: lp-mfx.
Am I doing something wrong?
I have a message:
*** error in function GUI_lp_mfx
> list Y = $ylist
Please help me
Thanks and regards
Can anyone of you know, how I can estimate the order for a given time
series data set. I can estimate the order for a AR or MA series separately
using the autocorrelation and partial autocorrelation pattern ( cut off
values), but it is not possible for mixed AR and MA. Is there any way to
estimate the order from GRETL?