function pz3
    %???????????? ??????????? ?????????????? ????????-?????
    N = 100;
    n = [1:1:N];
    S = sin(0.2*n);
    W = 0.2*randn(1,N);
    y = S+W;
    [A,R] = corrmtx(y, N-1);
    [V,L] = eig(R);
    % check property: lin
    %sum(V(:,3).*V(:,3));
    L = eig(R);
    y_v = 0;
    for i =1:N
        y_v = y_v + V(:,i)*L(i);
    end
    % optimization
    % find all y^
    L_temp = L;
    yv = zeros(N,N);
    for j = 1:N
        L_temp(j) = 0;
        for i =1:N
            yv(:,j) = yv(:,j) + V(:,i)*L_temp(i);
        end
    end
    % normalize
    for j = 1:N
        yv_normalize(:,j) = yv(:,j)/max(abs(yv(:,j)));
    end
    %y = y/max(abs(y));
    % minimization
    for j = 1:N-1
        cost_y(j) = sum((y' - yv_normalize(:,j)).^2);
    end
    [optim,i] = min(cost_y)
    plot(n,S,n,W,n,y,n,yv_normalize(:,i))
    %plot(1:1:99, cost_y)
end

