function thchap=thc2(X)
    
n=length(X);
Y=zeros(1,n-1);
for i=1:(n-1)
    Y(i)=X(i+1)*X(i);
end
W=sum(Y);
Xd=X(1:(n-1));
W2=sum(Xd.*Xd);
thchap=W/W2;
endfunction;
