Not a valid target for an assignment
이전 댓글 표시
I am trying to do a cross sectional regression and i get the error The expression to the left of the equals sign is not a valid target for an assignment. What should i do?
>> %whole sample CAPM
returns=xlsread('Stock Returns','B2:AE321');
factors=xlsread('Factors','B2:E321');
T=min(size(factors,1),size(returns,1));
beta=ones(30,2);
%Step 1:Time-series regression]
for i=1:30
alpha=[ones(T,1) factors(:,1)];
Y=returns(:,i)-factors(:,4);
coefficients(i,:)=(alpha\Y);
end
%Step 2:Cross-sectional regression
Market_Premium=ones(T,2);
for n=1:T
alpha01=[ones(30,1) coefficients(:,2)
Y=(returns(n,:)-factors(t,4))';
Y=(returns(n,:)-factors(t,4))';
↑
Error: The expression to the left of the equals sign is not a valid target for an assignment.

채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Support Vector Machine Regression에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!