Thank you Sven for your answer.
It is common practice to minimize the SSE in order to obtain the alpha
parameter in conjunction with exponential smoothing methods.
The goal is not to get a perfect smoothing but to adapt the smoothing method
to the data in order to do a better forecasting. Of course you have other
methods to do the forecasting....
By adding this feature you give an added value to "simple" users who are not
acquainted with functions and scripts and you make in this sense a more
user-friendly package...
Raul Gimeno
-----Ursprüngliche Nachricht-----
Von: gretl-users-bounces(a)lists.wfu.edu
[mailto:gretl-users-bounces@lists.wfu.edu] Im Auftrag von
gretl-users-request(a)lists.wfu.edu
Gesendet: Freitag, 25. September 2015 17:42
An: gretl-users(a)lists.wfu.edu
Betreff: Gretl-users Digest, Vol 104, Issue 36
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: exponential moving average (Allin Cottrell)
2. exponential moving average (Raul Gimeno)
3. Re: exponential moving average (Sven Schreiber)
4. Re: exponential moving average (Allin Cottrell)
5. Re: exponential moving average (Allin Cottrell)
6. Testing for homogeneity (Cameron Heimerdinger)
7. Re: exponential moving average (Allin Cottrell)
----------------------------------------------------------------------
Message: 1
Date: Thu, 24 Sep 2015 13:00:02 -0400 (EDT)
From: Allin Cottrell <cottrell(a)wfu.edu>
To: Gretl list <gretl-users(a)lists.wfu.edu>
Subject: Re: [Gretl-users] exponential moving average
Message-ID:
<alpine.LNX.2.20.3.1509241247300.1399(a)localhost.localdomain>
Content-Type: text/plain; charset=US-ASCII; format=flowed
On Thu, 24 Sep 2015, Allin Cottrell wrote:
On Thu, 24 Sep 2015, Raul Gimeno wrote:
>
Would it be possible to include a solver function like in Excel in
order to do minimizing calculations to find the optimal alpha?
The BFGSmax function can do this sort of thing. See the chapter on
Numerical methods in the User's Guide.
In fact the "nls" command should do the job more simply, as in:
<hansl>
series S = S0
nls y = S
S = S0
S = alpha * y(-1) + (1-alpha) * S(-1)
params alpha
end nls -v
</hansl>
where y is a data series, S is the series to hold the EMA, and S0 and alpha
are suitably initialized scalars. (This is the Hunter variant of EMA, where
S(t) is based on y(t-1) rather than y(t).)
Allin Cottrell
------------------------------
Message: 2
Date: Fri, 25 Sep 2015 11:05:33 +0200
From: "Raul Gimeno" <mrexito(a)vtxmail.ch>
To: <gretl-users(a)lists.wfu.edu>
Subject: [Gretl-users] exponential moving average
Message-ID: <007e01d0f771$55c01080$01403180$(a)vtxmail.ch>
Content-Type: text/plain; charset="iso-8859-1"
Dear Allin
I again insist on the exponential moving average calculation. The
calculation done by Gretl for the exponential moving average should be
slightly changed at the beginning of the series calculation according to me:
We have a = 0.1 and
Y(1) = 362 (first observation)
Y(2) = 381 (second observation)
The starting value in our case is 351 = EMA(0) = mean of the whole time
series.
EMA(1) = aY(1) + (1-a)EMA(0) = 0.1*362 + 0.9*351 = 352.10.
--> EMA(1) is the one-step forecast done in period 1 for period 2 =
--> Y^(1)
EMA(2) = aY(2) + (1-a)EMA(1) = 0.1*381 + 0.9*352.10 = 354.99
--> EMA(2) is the one-step forecast done in period 2 for period 3= Y^(2)
Gretl calculation is:
EMA(1) = 351
EMA(2) = aY(2) + (1-a)EMA(1) = 0.1*381 + 0.9*351 = 354
By doing so the observed value in period 1, Y(1) = 362 is not used at all.
This information is simply ignored!
By using the Gretl values I obtain a lower SSE as using my calculations
(done in Excel). I don't know whether it is always like this or it is due
to a particular example.
I want to choose the optimal parameter a that minimizes the SSE. Would it
be possible to include these feature within the menu without having to run a
script? I think about users like me who are not familiar with defining
functions and using BFGSmax.
Thank you in advance
Raul Gimeno
-----Urspr?ngliche Nachricht-----
Von: gretl-users-bounces(a)lists.wfu.edu
[mailto:gretl-users-bounces@lists.wfu.edu] Im Auftrag von
gretl-users-request(a)lists.wfu.edu
Gesendet: Donnerstag, 24. September 2015 18:00
An: gretl-users(a)lists.wfu.edu
Betreff: Gretl-users Digest, Vol 104, Issue 35
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: exponential moving average (Allin Cottrell)
----------------------------------------------------------------------
Message: 1
Date: Thu, 24 Sep 2015 10:11:42 -0400 (EDT)
From: Allin Cottrell <cottrell(a)wfu.edu>
To: Gretl list <gretl-users(a)lists.wfu.edu>
Subject: Re: [Gretl-users] exponential moving average
Message-ID:
<alpine.LNX.2.20.3.1509240907410.1399(a)localhost.localdomain>
Content-Type: text/plain; charset=US-ASCII; format=flowed
On Thu, 24 Sep 2015, Raul Gimeno wrote:
Dear Allin
Thank you for your answer.
Could you please remove the restriction for the exponential moving
average filter to allow up to T/2 observations for the mean
calculation?
As Jack said, that's now done in CVS. It will be in the snapshots shortly.
It would be helpful if all the fillters you find under
"variable"
like the exponential moving average have their own short explanation
in the Gretl's guide.
The more elaborate filters (e.g. Butterworth, Polynomial trend) have a Help
button in the set-up dialog box which gives some details. I think the best
thing here might be to add some help text for the EMA also.
I am using the Roberts formula but I get a different result from
Gretl
with alpha = 0.1
Value one-step forecast
Y(T) Y^ (T-1)
T = 0 351.2917
T = 1 362 352.363 = 0.1(362) + 0.9(351.2917) --> Gretl:
354.2625
T = 2 381
There seems to be a difference over dating assumptions here. What gretl does
is to put the initializer for the EMA into the first observation of the
output series (which gretl calls t = 1, there's no t = 0). Then the first
actual computed value is EMA(2) = a*Y(2) + (1-a)*EMA(1). It seems you are
placing the EMA initializer before the data start, and then doing the first
EMA calculation using Y(1).
So far as I can tell, the procedure gretl uses is that given by NIST
(
http://www.itl.nist.gov/div898/handbook/pmc/section3/pmc324.htm ) but I'm
not sure if there's a truly canonical approach here. (It's the sort of thing
that won't make any difference asymptotically.)
Would it be possible to include a solver function like in Excel in
order to do minimizing calculations to find the optimal alpha?
The BFGSmax function can do this sort of thing. See the chapter on Numerical
methods in the User's Guide.
Allin Cottrell
------------------------------
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users
End of Gretl-users Digest, Vol 104, Issue 35
********************************************
------------------------------
Message: 3
Date: Fri, 25 Sep 2015 11:53:24 +0200
From: Sven Schreiber <svetosch(a)gmx.net>
To: gretl-users(a)lists.wfu.edu
Subject: Re: [Gretl-users] exponential moving average
Message-ID: <56051994.9020104(a)gmx.net>
Content-Type: text/plain; charset=windows-1252; format=flowed
Am 25.09.2015 um 11:05 schrieb Raul Gimeno:
I want to choose the optimal parameter a that minimizes the SSE.
Would it be possible to include these feature within the menu without
having to run a script?
I am not convinced that minimizing the SSE is the universally appropriate
goal here. The trivial solution to obtaining a perfect fit is not to smooth
in the first place, so somehow this problem strikes me as ill-defined.
I am open for discussion, but as of now I would be opposed to this
"feature".
sorry,
sven
------------------------------
Message: 4
Date: Fri, 25 Sep 2015 07:38:12 -0400 (EDT)
From: Allin Cottrell <cottrell(a)wfu.edu>
To: Gretl list <gretl-users(a)lists.wfu.edu>
Subject: Re: [Gretl-users] exponential moving average
Message-ID:
<alpine.LNX.2.20.3.1509250730310.5509(a)localhost.localdomain>
Content-Type: text/plain; charset=US-ASCII; format=flowed
On Fri, 25 Sep 2015, Raul Gimeno wrote:
I again insist on the exponential moving average calculation. The
calculation done by Gretl for the exponential moving average should be
slightly changed at the beginning of the series calculation according
to me [...]
OK, I've taken another look at the literature and I accept your point:
it seems to be more common, when using the Roberts EMA formulation, to take
the initializer as a "pre-sample" value and therefore to start calculating
the filter at observation 1. The gretl code is now modified accordingly in
CVS and snapshots.
A couple of other modifications:
(1) I see that it's quite common for the EMA initializer to be an "a
priori"
value. That's now supported in the EMA dialog, and also in the
movavg() function which now has an optional 4th argument for supplying an
initial value.
(2) The EMA dialog now has a Help button which gives some details and refers
to the movavg() function.
Allin Cottrell
------------------------------
Message: 5
Date: Fri, 25 Sep 2015 07:53:46 -0400 (EDT)
From: Allin Cottrell <cottrell(a)wfu.edu>
To: Gretl list <gretl-users(a)lists.wfu.edu>
Subject: Re: [Gretl-users] exponential moving average
Message-ID:
<alpine.LNX.2.20.3.1509250738210.5509(a)localhost.localdomain>
Content-Type: text/plain; charset=US-ASCII; format=flowed
On Fri, 25 Sep 2015, Sven Schreiber wrote:
Am 25.09.2015 um 11:05 schrieb Raul Gimeno:
> I want to choose the optimal parameter a that minimizes the SSE.
> Would it be possible to include these feature within the menu without
> having to run a script?
I am not convinced that minimizing the SSE is the universally
appropriate goal here. The trivial solution to obtaining a perfect fit
is not to smooth in the first place, so somehow this problem strikes me as
ill-defined.
I am open for discussion, but as of now I would be opposed to this
"feature".
I share Sven's skepticism on this point. And as I've mentioned, it's easy to
do this using the "nls" command if you really want to.
IMO, calculating the min-SSE parameter makes sense only if one uses the
Hunter version of the EMA, s(t) = a*y(t-1) + (1-a)*s(t-1), in which case you
can't get a trivial perfect fit. But I notice that in this case there's no
guarantee that the "optimal" a satisfies 0 < a < 1.
Interestingly enough, the example given on the NIST website
http://www.itl.nist.gov/div898/handbook/pmc/section4/pmc431.htm has a local
SSE minimum at about a = -0.12 and a global minimum at about 1.68, with
nothing resembling a minimum in the "legitimate" range.
(Although they talk about applying the Marquardt procedure they don't
mention the result!)
Allin
------------------------------
Message: 6
Date: Fri, 25 Sep 2015 09:10:47 -0600
From: Cameron Heimerdinger <crh2010(a)rams.colostate.edu>
To: Gretl list <gretl-users(a)lists.wfu.edu>
Subject: [Gretl-users] Testing for homogeneity
Message-ID:
<CAJ_MJ7f7Y8aH5CxG+THTmURTM1c7bgFZjZqB2iFfVbX0Oh6Wmw(a)mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Is there an easy way in gretl to test whether or not a demand model
supports homogeneity?
Sincerely,
Cameron Heimerdinger
Masters Student, Agricultural, Environment and Resource Economics Admin
Assistant, Colorado State Forest Service
(970) 817-3943
crh2010(a)rams.colostate.edu