On Thu, 14 Sep 2017, Sven Schreiber wrote:
Am 14.09.2017 um 19:26 schrieb Allin Cottrell:
> if isscalar(ind)
> u=linspace(eps,1-eps,ind)';
> end
>
> be_values=u.^(k1-1).*(1-u).^(k2-1);
OK, now let's check the influence of this 'eps' thingy which according
to Ghysels is there for numerical stability AFAIU. (Here k2 == 1.02 so
k2-1 == 0.02, and I'm focusing on the final element in the u vector.)
<octave-session-part>
>> u = 1 - eps
u = 1.00000
>> (1-u) .^ 0.02
ans = 0.48633
>> (1-1) .^ 0.02
ans = 0
>>
</octave-session-part>
Thus if we put in a plain and simple 1, then we get the "blackboard
math" solution 0 for the last lag. If instead we use a fancy/fuzzy
1-eps, this turns into 0.49!
So I'm wondering whether the eps cure isn't worse than the original illness?
I agree with you this far: the role of "eps" in Ghysels' code is not
transparent to me; I'm not sure what the "numerical stability" that
it's said to promote really means here.
However, in relation to your example it appears that maybe it's
designed to prevent abrupt changes in weight at the ends of the lag
range. As you compute the weights they jump from and to zero at the
end-points; as Ghysels computes them the profile is smoother.
Actually meeting the advertised condition of "zero last lag" -- on
Ghysels' method -- requires that the coefficients are progressively
shrinking as we near the maximum lag. And that is achieved only if
theta[2] is substantially greater than theta[1]. (For example,
theta[1] = 1, theta[2] >= 2.)
Allin