This presentation is the property of its rightful owner.
Sponsored Links
1 / 69

第三讲 PowerPoint PPT Presentation


  • 93 Views
  • Uploaded on
  • Presentation posted in: General

第三讲. 经济与金融中的优化问题 本章主要介绍用 LINDO/LINGO 软件求解经济、 金融和市场营销方面的几个优化问题的案例。. 3.1 经济均衡问题极其应用.

Download Presentation

第三讲

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


5192215

LINDO/LINGO


5192215

3.1

  • ()()()(equilibrium)()


3 1 1

3.1 ()()3-1212t8t94.54t8t

3.1.1


5192215

  • 3-13/t(6t)

  • 2t192t24.52t33()3


5192215

  • 1234(t)A1A2A3A494.532.25(t)x1,x2,x3,x4

  • 9x1+4.5x2+3x3+2.5x4-A1-2A2-3A3-4A4.

  • A1+A2+A3+A4=x1+x2+x3+x4

  • A1,A2,A3,A4<=2;

  • x1,x2,x3,x4<=2;

  • A1,A2,A3,A4,x1,x2,x3,x4>=0


5192215

  • LINGO

  • MAX 9X1 + 4.5X2 + 3X3 + 2.25X4

  • - A1 - 2A2 - 3A3 - 4A4

  • SUBJECT TO

  • A1 + A2 + A3 + A4 - X1 - X2 - X3 - X4 = 0

  • A1 <= 2 A2 <= 2 A3 <= 2 A4 <= 2

  • X1 <= 2 X2 <= 2 X3 <= 2 X4 <= 2

  • END


3 1 2

3.1.2

  • 3.2 3.1()()3-21.52

  • 3-2


5192215

  • ()3.1

  • ()()

  • 3.1


5192215

  • 1234()(t) A1,A2,A3,A494.532.25()(t)X1,X2,X3,X42468()(t)B1,B2,B3,B4,15853()(t)Y1,Y2,Y3,Y4,AXAYBXBY3-1


5192215

  • ()3-1

  • AX+AY=A1+A2+A3+A4 (10)

  • BX+BY=B1+B2+B3+B4 (11)

  • AX+BX=x1+x2+x3+x4 (12)

  • AY+BY=Y1+Y2+Y3+Y4 (13)

  • SUB


5192215

  • MAX 9X1 + 4.5X2 + 3X3 + 2.25X4 + 15Y1 + 8Y2 + 5Y3 + 3Y4

  • - 2BX - 1.5AY - A1 - 2A2 - 3A3 - 4A4 - 2B1 - 4B2 - 6B3

  • - 8B4

  • SUBJECT TO

  • 2) - AY + A1 + A2 + A3 + A4 - AX = 0

  • 3) - BX + B1 + B2 + B3 + B4 - BY = 0

  • 4) - X1 - X2 - X3 - X4 + BX + AX = 0

  • 5) - Y1 - Y2 - Y3 - Y4 + AY + BY = 0

  • END


5192215

  • SUB A1 2

  • SUB A2 2

  • SUB A3 2

  • SUB A4 2

  • SUB X1 2

  • SUB X2 2

  • SUB X3 2

  • SUB X4 2

  • SUB B1 1

  • SUB B2 3

  • SUB B3 4

  • SUB B4 4

  • SUB Y1 1

  • SUB Y2 2

  • SUB Y3 3

  • SUB Y4 4


3 1 3

3.1.3

  • 3.3 543-3344412346132()3


5192215

3-3


5192215


5192215

  • NjSj(j=12...N)Mi(i=12...M)jbij()icijpj

  • (1)jSj(j=12...N)

  • (2)jpjj

  • (3)jSj(j=12...N)pj=0()

  • (4)jpjj3()


5192215

  • 0-1xijjixij=1xij=0()

  • bij*xij (14)

  • 01

  • xij<=Sj,j=1,2,...,N; (15)

  • xij<=cj,j=1,2,...,M; (16)

  • (15)(16)(14)


5192215

  • MODEL:

  • TITLE ;

  • SETS:

  • AUCTION: S;

  • BIDDER : C;

  • LINK(BIDDER,AUCTION): B, X;

  • ENDSETS

  • DATA:

  • [email protected](AUCTION.TXT);

  • BIDDER [email protected](AUCTION.TXT);

  • [email protected](AUCTION.TXT);

  • [email protected](AUCTION.TXT);

  • [email protected](AUCTION.TXT);


5192215

  • ENDDATA

  • [email protected](LINK: B*X);

  • @FOR(AUCTION(J):

  • [AUC_LIM] @SUM(BIDDER(I): X(I,J)) < S(J) );

  • @FOR(BIDDER(I):

  • [BID_LIM] @SUM(AUCTION(J): X(I,J)) < C(I) );

  • @FOR(LINK: @BND(0,X,1));

  • END

  • Global optimal solution found at iteration: 7

  • Objective value: 65.00000


5192215

B

A

D

C

  • 3.1.4

  • 3.4 3-26AD53-4


5192215


5192215

  • ADAD()

  • ()


5192215

  • 1.11.222Y(AB)AB

  • (1)AB2X(2AB)

  • (2)AB232X(3AB)

  • (3)AB343X(4AB)

  • ACBCBDCD20Y(j)X(ij)(i=234j=ABACBCBDCD)


5192215

  • T(ij)X(ij) (3-3)T(ij)X(ij)32T(3j)T(2j)T(ij)X(ij)T(ij)iX(ij)T(ij)X(ij)T(ij)X(ij)

  • (1)YX

  • (2)ABCD()()

  • (3)X(2AB)<=2,X(3AB)<=1X(4AB)<=1

  • ()


5192215

  • MODEL:

  • TITLE ;

  • SETS:

  • ROAD/AB,AC,BC,BD,CD/:Y;

  • CAR/2,3,4/;

  • LINK(CAR,ROAD): T, X;

  • ENDSETS

  • DATA:

  • ! () ;

  • !T=20,52,12,52,20

  • 30,53,13,53,30

  • 40,54,14,54,40;

  • ! (*) ;

  • T= 2052 1252 20

  • 5055 1555 50

  • 7057 1757 70;


5192215

  • ENDDATA

  • [OBJ] [email protected](LINK: T*X);! ;

  • ! ;

  • [NODE_A] Y(@INDEX(AB))+Y(@INDEX(AC)) = 6;

  • [NODE_B] Y(@INDEX(AB))=Y(@INDEX(BC))+Y(@INDEX(BD));

  • [NODE_C] Y(@INDEX(AC))+Y(@INDEX(BC))=Y(@INDEX(CD));

  • [NODE_D] Y(@INDEX(BD))+Y(@INDEX(CD))=6;

  • ! YX;

  • @FOR( ROAD(I):

  • [ROAD_LIM] @SUM(CAR(J): X(J,I)) = Y(I) );

  • ! X;

  • @FOR(LINK(I,J)|I#EQ#1: @BND(0,X(I,J),2) );

  • @FOR(LINK(I,J)|I#GT#1: @BND(0,X(I,J),1) );

  • END


5192215

3.2

  • 3.2.1

  • 3.5 (ABC)12(1943-1954)()3-6(500)1.300A19431.30030%195515%


5192215

3-6


5192215

  • (portfolio)1952MarkowitzMarkowitz()()3-6()


5192215

  • ()

  • *0

  • *()

  • *()


5192215

  • ABCR1R2R3(1)Ri(i=123)ED(),cov(covariance),3-6,

  • ER1=0.0890833, ER2=0.213667, ER3=0.234583. (17)


5192215

DR1=cov(R1,R1)=0.01080754,DR2=cov(R2,R2)=0.05839170,DR3=cov(R3,R3)=0.09422681,cov(R1,R2)=0.01240721,cov(R1,R3)=0.01307513,cov(R2,R3)=0.05542639(:LINGO).

,A,B,C

COV =


5192215

  • x1,x2x3A,B,C.,(1),

  • x1x2x30 x1+x2+x3=1

  • R=x1R1+x2R2+x3R3

  • ER=x1ER1+x2ER2+x3ER3

  • V=D(x1R1+x2R2+x3R3)=D(x1R1)+ D(x2R2)+ D(x3R3)

  • +2cov(x1R1,x2R2)+ 2cov(x1R1,x3R3)+ 2cov(x2R2,x3R3)

  • =x1^2DR1+ x2^2DR2+ x3^2DR3+2x1x2cov(R1,R2)

  • + 2x1x3cov(R1,R3)+ 2x2x3cov(R2,R3)

  • =xixjcov(Ri,Rj)

  • 15%

  • x1ER1+x2ER2+x3ER30.15

  • 192221V


5192215

  • LINDO

  • Title

  • MIN x1 + x2 + x3 + PBUD + PRET

  • Subject to

  • ! PBUDPRET

  • Fx1) .02161508 x1 + .02481442 x2 + .02615026 x3

  • + PBUD - 1.089083 PRET >= 0

  • Fx2) .02481442 x1 + .11678340 x2 + .11085278 x3

  • + PBUD - 1.213667 PRET >= 0

  • Fx3) .02615026 x1 + .11085278 x2 + .18845362 x3

  • + PBUD - 1.234583 PRET >= 0

  • BUD) x1 + x2 + x3 = 1

  • RET) 1.089083 x1 + 1.213667 x2 + 1.234583 x3 >= 1.2345

  • END

  • ! LINDO

  • QCP 5


5192215

  • LINGO

  • MODEL:

  • Title ;

  • SETS:

  • YEAR/1..12/;

  • STOCKS/ A, B, C/: Mean,X;

  • link(YEAR, STOCKS): R;

  • STST(Stocks,stocks): COV;

  • ENDSETS

  • DATA:

  • TARGET = 1.15;


5192215

  • ! R;

  • R =

  • 1.300 1.225 1.149

  • 1.103 1.290 1.260

  • 1.216 1.216 1.419

  • 0.954 0.728 0.922

  • 0.929 1.144 1.169

  • 1.056 1.107 0.965

  • 1.038 1.321 1.133

  • 1.089 1.305 1.732

  • 1.090 1.195 1.021

  • 1.083 1.390 1.131

  • 1.035 0.928 1.006

  • 1.176 1.715 1.908;

  • ENDDATA


5192215

  • CALC:!MeanCOV;

  • @for(stocks(i): Mean(i) =

  • @sum(year(j): R(j,i)) / @size(year) );

  • @for(stst(i,j): COV(i,j) = @sum(year(k):

  • (R(k,i)-mean(i))*(R(k,j)-mean(j))) / (@size(year)-1) );

  • ENDCALC

  • [OBJ] MIN = @sum(STST(i,j): COV(i,j)*x(i)*x(j));

  • [ONE] @SUM(STOCKS: X) = 1;

  • [TWO] @SUM(stocks: mean*x) >= TARGET;

  • END


5192215

  • LINDO

  • [email protected](year)-1

  • LINDO


5192215

  • 1.151.151.234523.45%CCC99.6%0.4%B


5192215

  • LINDOLINGOLINDO23.45%Reports|Parametrics3-3RETNew RHS Value1Graphics+2DOK3-4efficient frontier


5192215

  • 3-3Text

  • 4123.45%21.894%X1A29.357%X3C3~48.908%X2A3-4


3 2 2

3.2.2

  • 3.6 3.55%3.5

  • 3.50


3 2 3

3.2.3

  • 3.7 3.515%A50%B35%C15%3.51%


5192215

  • x1x2x3ABCABCy1y2y3ABCz1z2z3yizii=123

  • x1x2x30 y1y2y30 z1z2z30


5192215

  • x1+x2+x3=1y1=y2=y3=z1=z2=z3=011%

  • x1+x2+x3+0.01y1+y2+y3+z1+z2+z3=1.

  • cixiyizii=123

  • Xi=ci+yi-zi, i=1,2,3.


5192215

  • MODEL:

  • Title ;

  • SETS:

  • STOCKS/ A, B, C/: C,Mean,X,Y,Z;

  • STST(Stocks,stocks): COV;

  • ENDSETS

  • DATA:

  • TARGET = 1.15;


5192215

  • ! ;

  • c=0.5 0.35 0.15;

  • ! Mean,COV;

  • mean=1.089083 1.213667 1.234583;

  • COV=0.01080754 0.01240721 0.01307513

  • 0.01240721 0.05839170 0.05542639

  • 0.01307513 0.05542639 0.09422681;


5192215

  • ENDDATA

  • [OBJ] MIN = @sum(STST(i,j): COV(i,j)*x(i)*x(j));

  • [ONE] @SUM(STOCKS: X+0.01*Y+0.01*Z) = 1;

  • [TWO] @SUM(stocks: mean*x) >= TARGET;

  • @FOR(stocks: [ADD] x = c - y + z);

  • END


3 2 4

3.2.4

  • 3.8 3.515%10001000 2=4995003.5


3 2 5

3.2.5


5192215

  • downside risksemivariance


5192215

39 AB123-7AB


5192215

3.3

  • 3.3.1

  • 3.10 3-8ABCDAAABCD75%10%5%10%A


5192215

  • Markov chain1A


5192215

  • Nii=12NTijipi

  • Pi=Tjipi i=1,2,,N

  • NN1

  • pi=1

  • pi()


5192215

  • MODEL:

  • TITLE ;

  • SETS:

  • PROD/ A B C D/: P;

  • LINK(PROD, PROD): T;

  • ENDSETS

  • DATA: ! ;

  • T = .75 .1 .05 .1

  • .4 .2 .1 .3

  • .1 .2 .4 .3

  • .2 .2 .3 .3;


5192215

  • ENDDATA

  • @FOR(PROD(I)| I #LT# @SIZE(PROD):

  • !;

  • P(I)[email protected](LINK(J,I): P(J)* T(J,I)) );

  • @SUM(PROD: P) = 1;

  • @FOR(PROD(I):

  • @WARN( '1',

  • @ABS( 1 - @SUM(LINK(I,J): T(I,J)))

  • #GT# .000001); );

  • END


3 3 2

3.3.2

  • ,(),..,().,,,,1015.,,,,.,,?(conjint analysis).


5192215

3.11 :12.99.97.93-9()).?


5192215

  • H()M()L(),pj(j=H,M,L);0,1,2,,jic(i,j):

  • c(i,j)=pj+qi

  • ,?6(pjqi),9,pjqi.,

  • min[c(i,j)-c0(i,j)]^2,


5192215

  • ,c0(i,j)(ij).

  • ,c(i,j)c0(i,j):(i,j)(k,l),c0(i,j)+1<=c0(k,l),c(i,j)+1<=c(k,l)("+1"c(i,j)c(k,l),1).,:

  • min(1+pj+pi-pl-pk),

  • c0(i,j)+1<=c0(k,l)(i,j)(k,l).


5192215

  • MODEL:

  • TITLE ;

  • SETS:

  • PRICE /H, M, L/ : P;

  • SAFETY/2, 1, 0/ : Q;

  • M(safety, PRICE) : C0;

  • MM(M, M)|C0(&1,&2) #LT# C0(&3,&4): ERROR;


5192215

  • ENDSETS

  • DATA:

  • C0 = 7 8 9 3 4 6 1 2 5;

  • ENDDATA

  • @FOR( MM( i, j, k, l): ERROR( i, j, k, l) >=

  • 1 + ( P( j) + Q( i)) - ( P( l) + Q( k)) );

  • [obj] MIN = @SUM(mm: ERROR);

  • END


6 3 3

6.3.3

  • 6.12 A,B,C,H,H,-AH,HB,HC,120,100,110,,,,6-10.?


5192215

  • ,,,AH=33+24+12=69,HB=12+16=28,,?


5192215

  • 5AH,AB,AC,HB,HC,i(1,2,3,4,5),ai,pi;bi,qi,,AH,HB,HCc1=120,c2=100.c3=110..

  • i(i=1,2,3,4,5)xi,yi,.

  • ,

  • (pixi+qiyi)


5192215

  • :

  • (1).

  • ,AHAH,AB,AC,

  • x1+x2+x3+y1+y2+y3ci.

  • ,

  • x2+x4+y2+y4c2,

  • x3+x5+y3+y5c3,

  • (2):

  • 0xiai,0yibi,i=1,2,3,4,5.


5192215

  • TITLE LINDO

  • MAX 190 X1 + 90 Y1 + 244 X2 + 193 Y2 + 261 X3 + 199 Y3

  • + 140 X4 + 80 Y4 + 186 X5 + 103 Y5

  • S.T.

  • AH) X1 + Y1 + X2 + Y2 + X3 + Y3 <= 120

  • HB) X2 + Y2 + X4 + Y4 <= 100

  • HC) X3 + Y3 + X5 + Y5 <= 110

  • END


5192215

  • SUB X1 33

  • SUB X2 24

  • SUB X3 12

  • SUB X4 44

  • SUB X5 16

  • SUB Y1 56

  • SUB Y2 43

  • SUB Y3 67

  • SUB Y4 69

  • SUB Y5 17


  • Login