各位:
我用一下的一段程序进行VAR模型的规划求解,但是总是说没有解???
请问是什么原因呢?万分感激!!!
!VaR Model;
Model:
Sets:
Periods/Period1..Period218/:X,Y;!Define the array Periods;
Stocks/Stock1..Stock21/:Weight;!Define the array Stocks;
LINKS(Periods,Stocks):Return;!The return of 21 stocks in 218 weeks;
Endsets
Data:
[email=Return=@OLE(]Return=@OLE('E:lingo\var\In[/email] Smaple Stock Return Matrix.xls','ReturnMatrix');!Import the data from excel;
a=0.1;!Define5 the significance level;
RVar=-0.055;!Define the RVar;
Enddata
Max=(1/218)*@sum(Periods(I):X(I));
@for(Stocks(J):Weight(J)>=0);!the weight is larger than zero, short is not allowed;
@sum(Stocks(J):Weight(J))=1;!the sum of weights of stocks equals to 1;
@for(Periods(I):@bin(Y(I)));!the yi is integer 0 or 1;
@for(Periods(I):@sum(Stocks(J):Weight(J)*Return(I,J))=X(I));
@sum(Periods(I):1-Y(I))*(1/218)<=a;
Rmin=@min(Periods(I):X(I));!Rmin is the smallest return in 218 weeks for the portifolio;
@for(Periods(I):Rmin+(Rvar-Rmin)*Y(I)<=X(I));
end


雷达卡


京公网安备 11010802022788号







