`Hello Everybody, I'm trying to replicate in Matlab code the Redundant Haar`

Wavelet, as from the

http://strule.cs.qub.ac.uk/~gzheng/financial-engineering/finpapermay99.html

Following this statement,

"The non-decimated Haar algorithm is exactly the same as the trous

algorithm, except that the low-pass filter h, (1/16,1/4,3/8,1/4,1/16), is

replaced by the simpler filter (1/2, 1/2). There h is now non-symmetric."

I wrote this code in Matlab

appa';

for j = 0:4

for i = 1:l

if (i-2^j)==0

X = [app(i) app(1)];

else

X = [app(i) app(abs((i-2^j)))];

end

C(i)=(0.5*X(1)+0.5*X(2));

end

w((j+1),(1:l))=app(1:end)-C(1:end);

app = C;

end

D1 = w(1,(1:l));

D2 = w(2,(1:l));

D3 = w(3,(1:l));

D4 = w(4,(1:l));

D5 = w(5,(1:l));

A5 = C;

figure;

hold on;

plot(A5);

plot(A5+D5,'r-');

plot(A5+D5+D4,'g-');

plot(A5+D5+D4+D3,'y-');

plot(A5+D5+D4+D3+D2,'c-');

plot(A5+D5+D4+D3+D2+D1,'m-');

but there must be something wrong because I get lag when overplot the

details, while there shouldn't be any lag.

The symmetric version of the Haar do not show lag but it's not suitable

for finance application because of the distorsion effect on borders.

Any help is very much appreciated, thanks a lot!

Albert

PS I'm involved in financial market forecast using scientifics methods,

anyone interested in can contact me for collaboration, acepsut@acep...

Wavelet, as from the

http://strule.cs.qub.ac.uk/~gzheng/financial-engineering/finpapermay99.html

Following this statement,

"The non-decimated Haar algorithm is exactly the same as the trous

algorithm, except that the low-pass filter h, (1/16,1/4,3/8,1/4,1/16), is

replaced by the simpler filter (1/2, 1/2). There h is now non-symmetric."

I wrote this code in Matlab

appa';

for j = 0:4

for i = 1:l

if (i-2^j)==0

X = [app(i) app(1)];

else

X = [app(i) app(abs((i-2^j)))];

end

C(i)=(0.5*X(1)+0.5*X(2));

end

w((j+1),(1:l))=app(1:end)-C(1:end);

app = C;

end

D1 = w(1,(1:l));

D2 = w(2,(1:l));

D3 = w(3,(1:l));

D4 = w(4,(1:l));

D5 = w(5,(1:l));

A5 = C;

figure;

hold on;

plot(A5);

plot(A5+D5,'r-');

plot(A5+D5+D4,'g-');

plot(A5+D5+D4+D3,'y-');

plot(A5+D5+D4+D3+D2,'c-');

plot(A5+D5+D4+D3+D2+D1,'m-');

but there must be something wrong because I get lag when overplot the

details, while there shouldn't be any lag.

The symmetric version of the Haar do not show lag but it's not suitable

for finance application because of the distorsion effect on borders.

Any help is very much appreciated, thanks a lot!

Albert

PS I'm involved in financial market forecast using scientifics methods,

anyone interested in can contact me for collaboration, acepsut@acep...