Академический Документы
Профессиональный Документы
Культура Документы
of Applied Sciences
School of
Engineering
IDP Institute of
Data Analysis and
Process Design
Commodity Modelling
July 2, 2009
Commodity Modelling 1 / 33
Outline
1 Motivation
4 Using schwartz97
Parameter Estimation
Examples
Outline
1 Motivation
2 Commodity model types
3 Schwartz two-factor model in a nutshell
Model dynamics
Joint distribution of state variables
Pricing of basic derivatives
Risk measures
4 Using schwartz97
Parameter Estimation
Examples
Few parameters
Inflexible term sturcutre of futures prices
Numerous parameters
Flexible term sturcture generic
Two-factor model
Spot price Log-normal (Geometric Brownian motion)
Convenience yield Mean-reverting (Ornstein-Uhlenbeck)
Three-factor model
Spot price Log-normal (Geometric Brownian motion)
Convenience yield Mean-reverting (Ornstein-Uhlenbeck)
Interest rate Mean-reverting (Vasicek)
Outline
1 Motivation
4 Using schwartz97
Parameter Estimation
Examples
dSt = ( t ) St dt + S St dWS
dt = ( t ) dt + dW
dWS dW = dt
The Q-dynamics:
S
dSt = (r t ) St dt + S St d W
dt = [ ( t ) ] dt + d W
SdW
dW = dt
Outline
1 Motivation
2 Commodity model types
3 Schwartz two-factor model in a nutshell
Model dynamics
Joint distribution of state variables
Pricing of basic derivatives
Risk measures
4 Using schwartz97
Parameter Estimation
Examples
2
X P X X X
=N = , = ,
X 2
2
X Q
X X X
=N = , =
X 2
Outline
1 Motivation
4 Using schwartz97
Parameter Estimation
Examples
Futures
Futures prices:
1 2
G(S0 , 0 , T ) = EQ [ST ] = e X + 2 X
= S0 e A(T )+B(T )0
with
1 2 S 1 2 1 e 2T
A(T ) = r
+ T+
2 2 4 3
2 1 e T
+ + S
,
2
e T 1
B(T ) =
Futures
European Options
European Options
European call option:
C G = EQ e r t (G(St , t , T t) K )+
Put-call parity:
C G P G = P(0, t) {G(0, t) K }
European put option:
P G = P(0, t) {K (d ) G(0, T )(d+ )}
Outline
1 Motivation
Risk Measures
Outline
1 Motivation
2 Commodity model types
3 Schwartz two-factor model in a nutshell
Model dynamics
Joint distribution of state variables
Pricing of basic derivatives
Risk measures
4 Using schwartz97
Parameter Estimation
Examples
Object Orientation
Problem: Many parameters involved
The transition density of the state variables depends on 8 parameter:
(s0 , 0 , , S , , , , )
Example: dfutures
Outline
1 Motivation
4 Using schwartz97
Parameter Estimation
Examples
Transition equation:
The state variables are log-spot price and convenience yield.
Measurement equation:
Futures prices are measured. The log-futures price are an affine
function of the log-spot price and the convenience yield.
yt = ct + Zt t + Gt t , t N (0, In ) (4.2)
!
Xt+t
t+t = (4.4)
t+t
!
1 1
e t 1
Tt = (4.5)
0 e t
12 S2 t +
1 e t
dt = (4.6)
1 e t
!
0 X2 (t) X (t)
Ht Ht = (4.7)
X (t) 2 (t),
where Xt = log St and t = tk+1 tk .
IDP Winterthur, Clariden Leu Zrich
Commodity Modelling 25 / 33
Using schwartz97
yt = ct + Zt t + Gt t , t N (0, In ) (4.8)
log Gt (1) 1 B(mt (1))
.. .
. ..
yt =
.
Zt =
. .
(4.9)
log Gt (n) 1 B(mt (n))
A(mt (1)) 2
g11
.
..
0 ..
ct =
Gt G =
t .
(4.10)
A(mt (n)) 2
gnn
where mt (i) denotes the remaining time to maturity of the i-th
closest to maturity futures Gt (i).
Function fit2factor
Outline
1 Motivation
2 Commodity model types
3 Schwartz two-factor model in a nutshell
Model dynamics
Joint distribution of state variables
Pricing of basic derivatives
Risk measures
4 Using schwartz97
Parameter Estimation
Examples
IDP Winterthur, Clariden Leu Zrich
Commodity Modelling 28 / 33
Using schwartz97
Function fit2factor
> library(schwartz97)
Loading required package: FKF
Loading required package: mvtnorm
> data(futures)
> na.idx <- apply(is.na(copper$futures), 1, any)
> copper.fit <- fit2factor(copper$futures[!na.idx,], copper$ttm[!na.idx,],
+ control = list(maxit = 100, reltol = 1e-3),
+ silent = TRUE)
>
Function fit2factor
> copper.fit
----------------------------------------------------------------
Fitted Schwartz97 2 factor model:
d S_t = S_t * (mu - delta_t) * dt + S_t * sigmaS * dW_1
d delta_t = kappa * (alpha - delta_t) * dt + sigmaE * dW_2
E(dW_1 * dW_2) = rho * dt
s0 : 109.375364269883
delta0: 0
mu : 0.212827842930593
sigmaS: 0.37460428511304
kappa : 1.10747274866091
alpha : 0.0595560374598207
sigmaE: 0.474809676990843
rho : 0.813002684142751
r : 0.05
lambda: 0.0402214875501909
alphaT: 0.0232377735577751
----------------------------------------------------------------
Optimization information
Converged: TRUE
Fitted parameters: mu, sigmaS, kappa, alpha, sigmaE, rho, lambda, meas.sd1; (Num
log-Likelihood: 112485.1
Nbr. of iterations: 75
----------------------------------------------------------------
>
Function filter2factor
> filter2factor(copper$futures[!na.idx,], copper$ttm[!na.idx,], copper.fit)
>
350
Spot price
Closest to maturity futures
200
50
Index
0.5
Convenience yield
0.2
0.1
Index
IDP Winterthur, Clariden Leu Zrich
Commodity Modelling 31 / 33
Using schwartz97
Derivatives
Conclusion
Outlook
Implementing term-structure models (Juri Hinz & Max Fehr, 2007).
References