You are on page 1of 28

6

,
, .
[1].
,
.
(Solver),

. 6.1 6.2 . 6.36.5
. 6.6
, 6.76.9
Excel. Equity1.xls,
.

6.1

(, [1]). ,
,

6.

141

.
(, ,
).
:
;
.
, , ( wi )
, , 100%.
n ,
,
, .
:

E(rp ) =

n
!

wi E(ri ).

i=1

Var(rp ) =

p2

n !
n
!

wi wj cov(i, j), cov(i, i) = i2 .

i=1 j=1

E(ri ) i- , i (
) i- . cov(i, j) - . ,
, . , ,
.
, .
, :
Excel ,
.
.
- (
e w, - eT wT ),
- V,
. Excel.

II. :

142

w e

wT Vw

Excel
=(w;e)
(SUMPRODUCT(w,e))
=((w);(V;w))
(MMULT(TRANSPOSE(w),MMULT(V,w)))

. 6.1. : , , . 1926 1992 ,


Excel () (STDEV()) () (AVERAGE())
.
40%: 50%: 10%. (C5:C7) (I10:I12) e
w , (C15:E17)
V, Excel . , 40%: 50%: 10%
2,2% ( I15) 7,0% ( I16),
0,0049 ( I18).

. 6.1.

- .
( C10:E12) (D5:D7). , . 6.1
- :

6.

143

=C11*(C$14;$B$5:$D$7;3;)*($B16;$B$5:$D$7;3;)
=C11*VLOOKUP(C$14,$B$5:$D$7,3,FALSE)*VLOOKUP($B16,$B$5:$D$7,3,
FALSE)

: C11 ( ),
B5:D7,
.
VBA.
retvec wtsvec, vcvmat, PortfolioReturn(retvec,wtsvec) PortfolioVariance(wtsvec,vcvmat). , PortfolioVariance.
.
,
.
6.26.5 ,
.

6.2
,
. . 6.2
( x, y).
, . , , , ( 20,8%, 9,0%),
( 4,3%,
0,6%).
(. . 6.1),
, . 6.2. 2,2%,
. , (,
) . , ,

II. :

144

.
. , , . 1 , .

( )

. 6.2.


, .
,
(, ,
) . , ,

, ,
.
,
[2] , 6.4.
(Solver)
, , ,
.

6.

145

6.3

, . 6.3, ,
7%. ,
,
. , (Solver), .
,
.

. 6.3. 1 Equity1.xls

, , ,
[2]. , , . 6.3. ,
, change1 I11:I12, portret1 I15
..
,
( ). I10: =1-(I11:I12).

146

II. :

, I11:I12
( ) change1. , (I16), portsd1.
: portret1 ( I15)
, , target1 ( I5). (
, VBA,
.)

.
1. , (ToolsSolver).
2. (Solver Parameter)
(I16), ,
(. 6.4) (I11:I12).
3. (Add), ,
OK (. 6.4). I15
( I5).
4. (Options) , (Assume Linear Model).
5. (Solve), .
, :
( . 6.5). I15
, 15,7% 7%.
I5
. ( ,
I5 7% 3% . :
. portret1=target1, . 6.4,
0,7%
4,1%.)

, ,
. , (. . 6.5)
7%

6.

147

5,6% . ,
, ,
;
, .
.
.
, ,
,
.

. 6.4.

148

II. :

. 6.5. 7%-

6.4 (
)
(..
), . (, [3])
, . , ( ,
). ,
( 3).
Excel . ,
, .
1 (. 6.6) ,
. ( C5:C7)
e, (I5:I7) w, ( A24:A26) u.
C15:E17 V.
, (I11) wT Vw
Excel.
V1 , .

6.

149

. 6.6.

Excel () (MINVERSE()). 3 3
(H15:J17) : =(C15:E17).
, ( ) <Ctrl+Shift+Enter>.

{}, <F2> .
( g g + h),
(A, B, C D).
,
:
A = uT V1 e;

B = eT V1 e;

C = uT V1 u;

D = BC A2 .

- l = V1 e m = V1 u,
C24:C26 D24:D26, -

II. :

150
:
A = uT l;

B = eT l;

C = uT m.

A G23 =((u);l) (=MMULT(TRANSPOSE(u),l)) () (MMULT()),


( B C).
A, B, C D ,
.
,
g ( 0%) g + h ( 100%):
g=

Bm Al
;
D

h=

Cl Am
.
D

g h, 3 1, .
I24:I26 K24:K26 (. . 6.6).
, g 124, 20,5 3,5% ,
. : g + h 100%.
T g + hT
g h. , 7% ( 3338 . 6.6)
, 5,6% , 35,8% 69,8% ( D36:D38). ,
7%
. , , , . 6.5
(Solver)
.
g + hT , T .
. , Excel
XY 0 10% ,
. . 6.2
.
, , , .

6.

151

,
. 6.10 , . HLPortfolioWeights()
: expert, retvec, vcvmat rf. expert
, , retvec , vcvmat
, rf ( 1). . . 6.6 E36:E38 , , ,
.

6.5
- (, ),
.
. ,
. Excel 2 (. 6.7) H8:J8 ( portwts2),
, ( portmin2 portmax2 ).
, (. 6.8).

. 6.7. ,
2

152

II. :

. 6.8.

, ,
: 7,4% , 20,0% , 72,6% . 7%,
,
10%, 20%,
15,8%. 15,7%
; , ,
.
, (. 6.9). 6.12.
6,8 9,0%. ( , ,
.) 11 ,
11 , 11 ,
( 6,8 9,0%).
(. . 6.9) .
, ,
.
( : )
,
( 6.4).

6.

153

. 6.9.

6.6

, 6.76.9, , .
.
[5] . 7, , 8,
.
, . ( ) ,
, , . ,
.
:
;
;

154

II. :

, , .
. ,
:
U = E(rp ) 0,5Ap2 .
A ,
, . , , A
2 4, A = 3.
, , 6.1, .
:
:

E(rp ) = w1 E(r1 ) + w2 E(r2 ).


Var(rp ) = p2 = w12 12 + w22 22 + 2w1 w2 cov(1,2).

cov(1,2) : cov(1,2) = cor(1,2)1 2 .


rf .
, .
.

6.7 1.


(asset0) (asset1), .
. 6.10: 1%, asset1
, . asset1 ( H14) 0
100%, ,
asset0 asset1.
. 6.11.
( 6). . 6.11 ( , -

6.

155

. 6.10. 1,

. 6.11. 1

) asset1 3 (
, ). 0,01 ( 100% asset0)
asset1
, 0,006 ( 100%
asset1).

156

II. :

,
, asset1 ( 14)
:
E(r1 ) rf
w1 =
.
A12
35,9% , 0,012 (..
1,2%). ( 15) Prob1OptimalRiskyWeight ( 6.11).
, , ( asset0),
.
(, 4)
27%.

6.8 2.

.
, . 2 . 6.12, D25 0,23.

. 6.12. 2,

, asset1, ( . 6.13).
,

6.

157

, . ,
, asset1,
, asset2.
, asset2
, asset1.
asset1 asset2
,
( 87,7% asset1), 9,77%.

.
(w1 )

22 12 1 2
.
12 + 22 212 1 2

w1mv (87,7%, H24), (1 w1mv ). , 87,7% asset1,


(9,77%).
, , .
, , ,
asset1, asset2. . 6.13
, 3,
( ,
), 15%.
,
35,2% ( 14,7%).

:
E(r1 ) E(r2 )
w1opt = w1mv +
.
A(12 + 22 212 1 2 )
( H29) . :
(
. 0,033 ( 3,3%).
.
Prob2OptimalRiskyWeight(), 6.11.

II. :

158

. 6.13. 2

6.9 3.

. .
(
2), (, , 1).
. 6.14.
, , . 35%:65%. , R E(rR )
R , F1 . F1 ,
R
, ..
E(rR ) rf
.
R
( ,
[1]), , ,

6.

159

. 6.14. 3,

, , .
(.. ): E(R1 ) = E(r1 ) rf E(R2 ) = E(r2 ) rf .
:
F1opt =

22 E(R1 ) +

22 E(R1 ) + cov(1,2)E(R2 )
,
12 E(R2 ) cov(1,2)(E(R1 ) + E(R2 ))

E(R1 ) E(R2 ) rf .
, , .
41, , 10,5% asset1, 89,5% asset2.
, ,
. ,

E(rR ) rf
,
2
AR
.
.

160

II. :

, 68,0% 32% .
0,0292 0,0347. (
Prob1OptimalRiskyWeight(), H50.)
68% ,
H52:H54. Prob3OptimalWeightsVec(), , 6.11 ( I52:I54).
, . 6.15, asset1 asset2. , , : , , ,
. ( 2.)
100% ,
0% ( ) 150%
50% . ( ,
, .) ( 3)
, . .
12,5%.
, 3 CAPM, ,
, .

6.10
Module1 , Equity1.xls. ,
, ,
. , PortfolioReturn()
:
Function PortfolioReturn(retvec, wtsvec)
If Application.Count(retvec) = Application.Count(wtsvec) Then

6.

161

. 6.15. 3
If retvec.Columns.Count <> wtsvec.Columns.Count Then
wtsvec = Application.Transpose(wtsvec)
End If
PortfolioReturn = Application.SumProduct(retvec, wtsvec)
Else
PortfolioReturn = -1
End If
End Function

, . SumProduct() , , - .
, retvec wtsvec . , ,
wtsvec . ,
1.
,
, .
HLPortfolioWeights() (
Module1) .
. VBA
, , , -. ,

162

II. :

Excel VBA -.

, -. , uvec retvec -.
,
.
Dim i As Variant
l = Application.MMult(vinvmat, retvec)
m = Application.MMult(vinvmat, uvec)

l m ,
, Variant, ,
, . Mmult() vinvmat [n, n], retvec
[n, 1]. , , , - [n, 1].
, , : a, b, c d. d ,
. , a
uvec 1.
a = Application.Sum(Application.MMult(Application.Transpose(uvec), 1))

Mmult() - [1, n] - [n, 1]


[1, 1] ( ). Excel
, VBA Sum() .
, ,
, . Excel
, I24:I26 g.
VBA .
Dim wtsvec() As Variant
n = Application.Count(retvec)
ReDim wtsvec(n)
For i = 1 To n
gi = b * m(i, 1)-a * l(i, 1)
hi = c * l(i, 1)-a * m(i, 1)
wtsvec(i) = (gi + hi * expert)/d
Next i

wtsvec ,
Variant,

6.

163

ReDim.
.

6.11

Prob1OptimalRiskyWeight() VBA , 6.7.
(r1 sig1)
, (rf)
(rraval).
Function Prob1OptimalRiskyWeight(r1, rf, sig1, rraval)
Prob1OptimalRiskyWeight = (r1-rf)/(rraval * sig1^2)
End Function

Prob2OptimalRiskyWeight(), 2 3. : r1,
r2, sig1 sig2 ; corr12 ;
rraval ; rf
. 2 .
Function Prob2OptimalRiskyWeight(r1, r2, sig1, sig2, corr12,
rraval)
Dim cov12, vqr1, var2,minvarw, w, xr1, xr2
cov12 = corr12 * sig1 * sig2
var1 = sig1^2
var2 = sig2^2
If rf <= 0 Then
minvarw = (var2--cov12)/(var1 + var2-2*cov12)
w = minvarw + (r1--r2)/(rraval*(var1 + var2-2*cov12))
Else
xr1 = r1--rf
xr2 = r2--rf
w = xr1*var2-xr2*cov12
w = w /(xr1*var2 + xr2*var1-(xr1 + xr2)*cov12)
End If
Prob2OptimalRiskyWeight = w
End Function

( cov12). minvarw

II. :

164

w1mv , w w1opt , .
3 , 1 2. Prob3OptimalWeightsVec()
. .
Function Prob3OptimalWeightsVec(r1, r2, sig1, sig2, corr12,
rraval)
Dim w0, w1, w2, rr, sigr
w1 = Prob2OptimalRiskyWeight(r1, r2, rf, sig1, sig2, corr12, _
rrava)
w2 = 1-w1
rr = w1*r1 + w2*r2
sigr = Sqr((w1*sig1)^2 + (w2*sig2)^2 + 2*w1*w2*corr12*sig1* _
sig2)
w0 = 1-Prob1OptimalRiskyWeight(rr, rf, sigr, rraval)
w1 = (1-w0)*w1
w2 = (1-w0)*w2
Prob3OptimalWeightsVec = Array(w0, w1, w2)
End Function

2
asset1 asset2:
w1 = Prob2OptimalRiskyWeight(r1, r2, rf, sig1, sig2, corr12, _
rrava)
w2 = 1-w1

:
rr = w1*r1 + w2*r2
sigr = Sqr((w1*sig1)^2 + (w2*sig2)^2 + 2*w1*w2*corr12*sig1*sig2)

( , 1). Prob1OptimalRiskyWeight().

6.12
,
(Solver), ModuleM. , (Tools). , VBA,
SOLVER.xla.
Sub EffFrontier1()
SolverReset

6.

165

Call SolverAdd(Range("portret1"), 2, Range("target1"))


Call SolverOk(Range("portsd1"), 2, 0, Range("change1"))
Call SolverSolve(True)
SolverFinish
End Sub

EffFrontier1 . SolverAdd() (
2 ), SolverOk()
( 2 ). SolverSolve() ( True
), SolverFinish()
.
, Call , , , .
.
EffFrontier2 , Solver()
. .
, . , SolverChange()
( ).
Solver()
PasteSpecial. .
Do While iter <= niter
Call SolverSolve(True)
SolverFinish
Range("portwts2").Copy
Range("effwts2").Offset(iter, 0).PasteSpecial Paste:=xlValues
Range("priter2") = Range("priter2").Value + pradd
Call SolverChange(Range("portret"), 2, Range("priter2"))
iter = iter + 1
Loop

,
,
( SolverOk() 2),
( SolverOk() 1).
, .

166

II. :

SolverReset
Call SolverAdd(Range("portwts2"), 3,
Range("portmin2"))
Call SolverAdd(Range("portwts2"), 1,
Range("portmax2"))
Call SolverOk(Range("portret2"), 2, 0,
Range("change2"))
Call SolverSolve(True)
SolverFinish
prmin = Range("portret2").Value
Call SolverOk(Range("portret2"), 1, 0, Range("change2"))
Call SolverSolve(True)
SolverFinish

, , , . ,

,
Excel. , ,
.
, .
, , (Solver). , ,
,
; , ,
. , (
).
7, , .

.

6.

167


1. ., ., . , 4- . . : , 2002. 984 .
2. Huang C. and Litzenberger R. Foundations for Financial Economics. New
York : North Holland, 1988.
3. Eppen G. D., Gould F. J., Schmidt C. P., Moore J. H. and Weatherford L. R. Introductory Management Science, Decision Modelling with Spreadsheets, 5th ed.
New Jersey : Prentice Hall, 1998.
4. Elton E. J. and Gruber M. J. Modern Portfolio Theory and Investment Analysis.
Chichester : John Wiley & Sons, 1995.
5. Taggart R. A. Quantitative Analysis for Investment Management. New Jersey :
Prentice Hall, 1996.