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!