clear all
close all

T = 5000*12;
f = randn(T,1);
rf = zeros(T,1);
rlbls = 'r';
flbls = 'f';
if 0;
    rx = 1*f + randn(T,1);
    disp('feeding asness beta 1 with no lags')
end
if 0; 
    rx = 1*f(3:T)+1*f(2:T-1)+1*f(1:T-2)+randn(T-2,1);
    f = f(3:T);
    rf = rf(3:T);
    disp('feeding asness beta with two lags');
end;
if 0; 
    rx = 1*f.*(f>0)+2*f.*(f<0)+1*randn(T,1);
    disp('feeding asness 1 up 2 down beta with no lags');
end;
if 0; 
    rx = 1*f(3:T).*(f(3:T)>0)+2*f(3:T).*(f(3:T)<0)+...
         1*f(2:T-1).*(f(2:T-1)>0)+2*f(2:T-1).*(f(2:T-1)<0)+...
          1*f(1:T-2).*(f(1:T-2)>0)+2*f(1:T-2).*(f(1:T-2)<0)+1*randn(T-2,1);
      rf = rf(3:T);
      f = f(3:T);
    disp('feeding asness 1 up 2 down beta with 2 lags');
end;
if 1; 
    f2 = randn(T,1);
    rx = f + 2*f2 + randn(T,1);
    disp('feeding asness 1 on factor 1, 2 on factor 2, no lags, no up/down');
    flbls = {'f1','f2'};
    f = [f f2];
end;


lead = 0;
lag = 3;

asness(rx,f,rf,rlbls,flbls,lead,lag) 
