function [m_ro,m_b,m_df,m_significance,m_sigma,m_hplank,m_stdx,m_stddx,m_stdxstddx,m_covxdx,m_pribkvadr]=geizenberg(SRC,wind,sstep,donormalize);

y=SRC;
n=length(y);

m_ro=[];
m_b=[];
m_df=[];
m_significance=[];
m_sigma=[];
m_hplank=[];
m_stdx=[];
m_stddx=[];
m_stdxstddx=[];
m_covxdx=[];
m_pribkvadr=[];
pribkvadr=log(y(2:n)./y(1:n-1));
if (donormalize)
    pribkvadr=(pribkvadr-mean(pribkvadr))/std(pribkvadr);
end


for i=1:sstep:n-wind-1

y2=y(i+1:i+wind);
y1=y(i:i+wind-1);

ro=corrcoef(y1,y2);
ro=ro(1,2);
i
pribkvadrw=mean(pribkvadr(i:i+wind-2).^2);
m_pribkvadr=[m_pribkvadr,pribkvadrw];

%[b,tstat,significance_real]=adftest_my(y1,y2,1);
[H, PValue, TestStat, CriticalValue] = dfARDTest(y2);%, Lags, Alpha, TestType)
b=PValue;%
tstat=[TestStat;CriticalValue]; % Фактически т-статистика
significance_real=CriticalValue; % Критическое значение для т-статистики.
devs_acor=y2-ro*y1;
sigma=std(devs_acor);



stdx=std(y1);

stddx=std(y2-y1);

covxdx=corrcoef(y1,y2-y1);
covxdx=covxdx(1,2);

hplank=1.3*sigma^2; %varx;%

stdxstddx=stdx*stddx;


form01t=2*var(y1)*(1-ro);
form01e=stddx^2;

form02t=-(1-ro)*var(y1);
form02e=((y1-mean(y1))*transpose((y2-y1)-mean(y2-y1))/249);

form03t=(1-ro)/2;
form03e=form02e^2;

form06t=sigma^2/(1-ro^2);
form06e=0;

form07t=2*sigma^2/(1+ro);
form07t=0;

m_ro=[m_ro,ro];
m_b=[m_b,b];%tstat];
m_df=[m_df,tstat];
m_significance=[m_significance,significance_real];
m_sigma=[m_sigma,sigma];
m_hplank=[m_hplank,hplank];
m_stdx=[m_stdx,stdx];
m_stddx=[m_stddx,stddx];
m_stdxstddx=[m_stdxstddx,stdxstddx];
m_covxdx=[m_covxdx,covxdx];
end