Loop for differencing non-stationary time series
by Marcin Pietrzak
Hi,
I want to write a loop which will test a time series for non-stationary and
if it do not pass ADF test the loop will automatically produce first
differences.
loop foreach i xlist
adf 40 xlist.$i --test-down
genr p.$i = $pvalue
if p.$i > 0,05
genr d_xlist.$i = diff(xlist.$i)
endloop
Gretl has some problems with if, it shows that it is not correct. Do
anybody have any idea?
Marcin Pietrzak
12 years, 10 months
Re: [Gretl-users] Gretl-users Digest, Vol 69, Issue 18
by 佃鹏 于
>Dear Allin,
Thank you for your reply. I changed my data structure and run the vector Autoregression to know the Granger Causality of variables, when I input the endogenous variables. it comes up with " insufficient degrees of freedom for regression" what's the problem here?
Thanks Dianpeng
> From: gretl-users-request(a)lists.wfu.edu
> Subject: Gretl-users Digest, Vol 69, Issue 18
> To: gretl-users(a)lists.wfu.edu
> Date: Thu, 18 Oct 2012 09:07:15 -0400
>
> Send Gretl-users mailing list submissions to
> gretl-users(a)lists.wfu.edu
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.wfu.edu/mailman/listinfo/gretl-users
> or, via email, send a message with subject or body 'help' to
> gretl-users-request(a)lists.wfu.edu
>
> You can reach the person managing the list at
> gretl-users-owner(a)lists.wfu.edu
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Gretl-users digest..."
>
>
> Today's Topics:
>
> 1. Re: forecasting with exponential smoothing (Pedro Ba??o)
> 2. Granger Causality test in Gretl (?? ?)
> 3. Re: Granger Causality test in Gretl (H?lio Guilherme)
> 4. Re: Granger Causality test in Gretl (Allin Cottrell)
> 5. Gamma distribution in gretl? (mariusz doszy?)
> 6. Gretl on Mac OS X 10.8.2 (Luc Hens)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 17 Oct 2012 17:22:40 +0100
> From: Pedro Ba??o <pmab(a)fe.uc.pt>
> Subject: Re: [Gretl-users] forecasting with exponential smoothing
> To: walt(a)dataanalyticscorp.com, Gretl list <gretl-users(a)lists.wfu.edu>
> Message-ID:
> <CAMwCGMeAUXnL+vjR4mhfEwp5n0h41=MvypSJRbw8r1zF82FSSA(a)mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> perhaps this will do it:
>
> smpl 1 20
> series x=movavg(y,0.5) # change the parameter 0.5
> smpl 21 25
> series f=x[20]
> matrix f_stats=fcstats(y,f)
> f_stats
> smpl full
>
> where y is the series to forecast, f has the forecasts, x is the smoothed
> series and f_stats is the matrix with the forecast statistics. You can then
> plot y and f. For a moving average, set the parameter 0.5 to an integer>1.
>
> On 15 October 2012 12:04, Data Analytics Corp.
> <walt(a)dataanalyticscorp.com>wrote:
>
> > Hi,
> >
> > I'd like to illustrate for students forecasting for just a few
> > steps-ahead with simple exponential smoothing. The filter option allows
> > for exponential smoothing (the movavg function does the same) but I
> > can't get a forecast with a forecast graph and forecast errors similar
> > to what I get with, say, the AR option in modeling. In particular, if I
> > have 25 observations, I'd like to set the sample size to the first 20,
> > do the smoothing, forecast the next 5, graph all 25 along with the 5
> > forecasted values, and calculate error statistics for the 5 forecasted
> > values using the 5 hold-out values. How can I do this? Is there a
> > script that would accomplish what I want? I'd like to also do the same
> > for a simple moving average.
> >
> > Thanks,
> >
> > Walt
> >
> > ________________________
> >
> > Walter R. Paczkowski, Ph.D.
> > Data Analytics Corp.
> > 44 Hamilton Lane
> > Plainsboro, NJ 08536
> > ________________________
> > (V) 609-936-8999
> > (F) 609-936-3733
> > walt(a)dataanalyticscorp.com
> > www.dataanalyticscorp.com
> > _____________________________________________________
> > _______________________________________________
> > Gretl-users mailing list
> > Gretl-users(a)lists.wfu.edu
> > http://lists.wfu.edu/mailman/listinfo/gretl-users
> >
> >
> >
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.wfu.edu/pipermail/gretl-users/attachments/20121017/05c16e41/...
>
> ------------------------------
>
> Message: 2
> Date: Wed, 17 Oct 2012 21:52:16 +0000
> From: ?? ? <dianpenginuk(a)live.cn>
> Subject: [Gretl-users] Granger Causality test in Gretl
> To: <gretl-users(a)lists.wfu.edu>
> Message-ID: <BAY170-W25C4C656BBC69EC5CB8F3FC8770(a)phx.gbl>
> Content-Type: text/plain; charset="gb2312"
>
>
> To whom it may concern,
>
> Sorry to bother you. I am a student from University of Glasgow UK. For my dissertation purpose I need to run Granger Causality tests using Gretl. I am using panel data, "time series" function didn't work? Would you mind giving me some advice on the following questions:
> Is the Granger Causality test for autoregression?
> How to run Granger Causality in Gretl using panel data? Do I need to change my data structure to time series in order to finish the Granger causality test of variables.
> Thank you for your time
> Best regardsDianpeng
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.wfu.edu/pipermail/gretl-users/attachments/20121017/3701ca74/...
>
> ------------------------------
>
> Message: 3
> Date: Thu, 18 Oct 2012 00:05:01 +0100
> From: H?lio Guilherme <helioxentric(a)gmail.com>
> Subject: Re: [Gretl-users] Granger Causality test in Gretl
> To: Gretl list <gretl-users(a)lists.wfu.edu>
> Message-ID:
> <CABNCgGSAaRJhAchtYA5dnu_s0usm7qj+ygDJsFJdS78exDT3iQ(a)mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> Hi,
>
> I did a simple query in Google and found an explanation for the
> Granger-causality test at
> http://en.wikipedia.org/wiki/Granger_causality
>
> It does seems to be applicable only to time-series.
>
> I recommend to get better references on that matter.
>
> What does the excelent Gretl documentation (Reference or Guide) say about it?
>
> Good luck.
>
> On Wed, Oct 17, 2012 at 10:52 PM, ?? ? <dianpenginuk(a)live.cn> wrote:
> > To whom it may concern,
> >
> > Sorry to bother you. I am a student from University of Glasgow UK. For my
> > dissertation purpose I need to run Granger Causality tests using Gretl. I
> > am using panel data, "time series" function didn't work? Would you mind
> > giving me some advice on the following questions:
> >
> > Is the Granger Causality test for autoregression?
> >
> > How to run Granger Causality in Gretl using panel data? Do I need to change
> > my data structure to time series in order to finish the Granger causality
> > test of variables.
> >
> > Thank you for your time
> >
> > Best regards
> > Dianpeng
> >
> >
> >
> > _______________________________________________
> > Gretl-users mailing list
> > Gretl-users(a)lists.wfu.edu
> > http://lists.wfu.edu/mailman/listinfo/gretl-users
>
>
>
> ------------------------------
>
> Message: 4
> Date: Wed, 17 Oct 2012 20:02:50 -0400 (EDT)
> From: Allin Cottrell <cottrell(a)wfu.edu>
> Subject: Re: [Gretl-users] Granger Causality test in Gretl
> To: Gretl list <gretl-users(a)lists.wfu.edu>
> Message-ID: <alpine.LFD.2.01.1210171952360.1488@myrtle>
> Content-Type: text/plain; charset="gb2312"
>
> On Wed, 17 Oct 2012, ?? ? wrote:
>
> > Sorry to bother you. I am a student from University of Glasgow UK.
> > For my dissertation purpose I need to run Granger Causality tests
> > using Gretl. I am using panel data, "time series" function didn't
> > work? Would you mind giving me some advice on the following
> > questions:
>
> > Is the Granger Causality test for autoregression?
>
> The Granger test is not "for" autoregression, but it is conducted in
> the framework of a vector autoregression (VAR).
>
> > How to run Granger Causality in Gretl using panel data? Do I need
> > to change my data structure to time series in order to finish the
> > Granger causality test of variables.
>
> The theory of Granger causality is well developed for the time
> series case. For panel data it is more complicated; for one thing
> you'd have to decide if the causality result is supposed to be in
> common ("homogeneous") across your panel units, or not. If you
> google "Granger causality panel data" you'll find discussions of
> this.
>
> In gretl, Granger causality tests are provided among the results
> when estimating a VAR, but the "var" command is not available for
> panel data, only time series. I think this is true of most
> econometric software. Gretl scripting has the flexibility to allow
> you to construct a related test for panel data, if you can figure
> out exactly what it is you want to test.
>
> Allin Cottrell
>
> ------------------------------
>
> Message: 5
> Date: Thu, 18 Oct 2012 10:35:20 +0200
> From: mariusz doszy? <madosz(a)wp.pl>
> Subject: [Gretl-users] Gamma distribution in gretl?
> To: "gretl-users" <gretl-users(a)lists.wfu.edu>
> Message-ID: <507fbf48de9c76.68846749(a)wp.pl>
> Content-Type: text/plain; charset="us-ascii"
>
> An HTML attachment was scrubbed...
> URL: http://lists.wfu.edu/pipermail/gretl-users/attachments/20121018/a5629910/...
>
> ------------------------------
>
> Message: 6
> Date: Thu, 18 Oct 2012 14:58:17 +0200
> From: Luc Hens <luc.hens.econ(a)vub.ac.be>
> Subject: [Gretl-users] Gretl on Mac OS X 10.8.2
> To: gretl-users(a)lists.wfu.edu
> Message-ID: <8C8B3547-A0CF-46D5-8D7D-99E4946B73B2(a)vub.ac.be>
> Content-Type: text/plain; charset="windows-1252"
>
> I installed Gretl on a MacBook Pro running OS X 10.8.2. When I leave Gretl in the disk image, it runs fine. However, when I move Gretl to the Applications folder it appears greyed out (and with a no-go trafiic sign across the icon) and won't run. Does anyone know what is going on and how to fix this?
>
> L u c H e n s
> -------------------------------------------------------
> Vrije Universiteit Brussel & Vesalius College
> Pleinlaan 2 ? Room C2.146 ? B-1050 Brussels ? Belgium
> office hours: Wednesdays 13:00-16:00, Karel Van Miert building (Pleinlaan 5), mezzanine
> e-mail: luc.hens.econ(a)vub.ac.be
> home page: http://homepages.vub.ac.be/~lmahens/
> Vesalius College: www.vesalius.edu
> Vrije Universiteit Brussel: http://www.vub.ac.be/
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.wfu.edu/pipermail/gretl-users/attachments/20121018/4a4f4cb5/...
>
> ------------------------------
>
> _______________________________________________
> Gretl-users mailing list
> Gretl-users(a)lists.wfu.edu
> http://lists.wfu.edu/mailman/listinfo/gretl-users
>
> End of Gretl-users Digest, Vol 69, Issue 18
> *******************************************
12 years, 10 months
Gretl on Mac OS X 10.8.2
by Luc Hens
I installed Gretl on a MacBook Pro running OS X 10.8.2. When I leave Gretl in the disk image, it runs fine. However, when I move Gretl to the Applications folder it appears greyed out (and with a no-go trafiic sign across the icon) and won't run. Does anyone know what is going on and how to fix this?
L u c H e n s
-------------------------------------------------------
Vrije Universiteit Brussel & Vesalius College
Pleinlaan 2 • Room C2.146 • B-1050 Brussels • Belgium
office hours: Wednesdays 13:00-16:00, Karel Van Miert building (Pleinlaan 5), mezzanine
e-mail: luc.hens.econ(a)vub.ac.be
home page: http://homepages.vub.ac.be/~lmahens/
Vesalius College: www.vesalius.edu
Vrije Universiteit Brussel: http://www.vub.ac.be/
12 years, 10 months
Granger Causality test in Gretl
by 佃鹏 于
To whom it may concern,
Sorry to bother you. I am a student from University of Glasgow UK. For my dissertation purpose I need to run Granger Causality tests using Gretl. I am using panel data, "time series" function didn't work? Would you mind giving me some advice on the following questions:
Is the Granger Causality test for autoregression?
How to run Granger Causality in Gretl using panel data? Do I need to change my data structure to time series in order to finish the Granger causality test of variables.
Thank you for your time
Best regardsDianpeng
12 years, 10 months
forecasting with exponential smoothing
by Data Analytics Corp.
Hi,
I'd like to illustrate for students forecasting for just a few
steps-ahead with simple exponential smoothing. The filter option allows
for exponential smoothing (the movavg function does the same) but I
can't get a forecast with a forecast graph and forecast errors similar
to what I get with, say, the AR option in modeling. In particular, if I
have 25 observations, I'd like to set the sample size to the first 20,
do the smoothing, forecast the next 5, graph all 25 along with the 5
forecasted values, and calculate error statistics for the 5 forecasted
values using the 5 hold-out values. How can I do this? Is there a
script that would accomplish what I want? I'd like to also do the same
for a simple moving average.
Thanks,
Walt
________________________
Walter R. Paczkowski, Ph.D.
Data Analytics Corp.
44 Hamilton Lane
Plainsboro, NJ 08536
________________________
(V) 609-936-8999
(F) 609-936-3733
walt(a)dataanalyticscorp.com
www.dataanalyticscorp.com
_____________________________________________________
12 years, 10 months
Differencing loop
by Marcin Pietrzak
Hi everyone,
I am writing to you in order to find some help concerning construction of
the loop. My aim is to build a loop which automatically create a first
differences of each time serie if it does not pass the ADF test. You can
find below my script but there is something wrong with it because it shows
a problem with commaf 'if'.
loop foreach i xlist
adf 30 xlist.$i --test-down
genr p$i = $pvalue
if p$i < 0,05
genr d_i = diff(xlist.$i)
endloop
Do you have any ideas what should be changed?
12 years, 10 months