Learn R Programming

schwartz97 (version 0.0.6)

distribution-futures: Schwartz two-factor Model: Distribution of Futures Prices

Description

Density, distribution function, quantile function and random number generation of futures prices.

Usage

"dfutures"(x, time = 0.1, ttm = 1, s0 = 50, delta0 = 0, mu = 0.1, sigmaS = 0.3, kappa = 1, alpha = 0, sigmaE = 0.5, rho = 0.75, r = 0.05, lambda = 0, alphaT = NULL, measure = c("P", "Q"), ...)
"dfutures"(x, time = 0.1, ttm = 1, s0, r = 0.05, lambda = 0, alphaT = NULL, measure = c("P", "Q"), ...)
"dfutures"(x, time = 0.1, ttm = 1, s0, measure = c("P", "Q"), ...)
"pfutures"(q, time = 0.1, ttm = 1, s0 = 50, delta0 = 0, mu = 0.1, sigmaS = 0.3, kappa = 1, alpha = 0, sigmaE = 0.5, rho = 0.75, r = 0.05, lambda = 0, alphaT = NULL, measure = c("P", "Q"), ...)
"pfutures"(q, time = 0.1, ttm = 1, s0, r = 0.05, lambda = 0, alphaT = NULL, measure = c("P", "Q"), ...)
"pfutures"(q, time = 0.1, ttm = 1, s0, measure = c("P", "Q"), ...)
"qfutures"(p, time = 0.1, ttm = 1, s0 = 50, delta0 = 0, mu = 0.1, sigmaS = 0.3, kappa = 1, alpha = 0, sigmaE = 0.5, rho = 0.75, r = 0.05, lambda = 0, alphaT = NULL, measure = c("P", "Q"), ...)
"qfutures"(p, time = 0.1, ttm = 1, s0, r = 0.05, lambda = 0, alphaT = NULL, measure = c("P", "Q"), ...)
"qfutures"(p, time = 0.1, ttm = 1, s0, measure = c("P", "Q"), ...)
"rfutures"(n, time = 0.1, ttm = 1, s0 = 50, delta0 = 0, mu = 0.1, sigmaS = 0.3, kappa = 1, alpha = 0, sigmaE = 0.5, rho = 0.75, r = 0.05, lambda = 0, alphaT = NULL, measure = c("P", "Q"))
"rfutures"(n, time = 0.1, ttm = 1, s0, r = 0.05, lambda = 0, alphaT = NULL, measure = c("P", "Q"))
"rfutures"(n, time = 0.1, ttm = 1, s0, measure = c("P", "Q"))

Arguments

q, x
vector of quantiles.
p
vector of probabilities.
n
number of observations. If length(n) > 1, the length is taken to be the number required.
time
Time where the futures process is evaluated (relative to now).
ttm
Time to maturity (relative to now).
s0
Either a numeric representing the initial value of the commodity spot price or an object inheriting from class schwartz2f.
delta0
Initial value of the convenience yield.
mu
Drift term of commodity spot price.
sigmaS
Diffusion parameter of the spot price process.
kappa
Speed of mean-reversion of the convenience yield process.
alpha
Mean-level of the convenience yield process.
sigmaE
Diffusion parameter of the convenience yield process.
rho
Correlation coefficient between the Brownian motion driving the spot price and the convenience yield process.
lambda
Market price of convenience yield risk (see Details).
alphaT
Mean-level of the convenience yield process with respect to the equivalent martingale measure (see Details).
r
Instantaneous risk-free interest rate.
measure
under which the functions are computed. “P” denotes the objective measure, “Q” the risk-neutral measure (see Details).
...
Arguments to be passed to the functions d/p/q-norm.

Value

Probabilities, densities, quantiles or samples of the log-normally distributed futures prices as numeric.

Details

Futures prices depend on the spot-price and the convenience yield.

To get the real (i.e. the objective) distribution of futures prices at some date in the future the dynamics is considered under the objective measure P. The P-dynamics is

$$dS_t = (\mu - \delta_t) S_t dt + \sigma_S~S_t~dW_t^1,$$

$$d \delta_t = \kappa (\alpha - \delta_t) dt +\sigma_E dW_t^2$$ $$dW_t^1~dW_t^2 = \rho dt,$$ where $W1, W2$ are Brownian motions under the objective measure, the measure P.

Options on futures are evaluated based on the risk-neutral dynamics of the spot-price and the convenience yield, i.e. under the measure Q. The Q-dynamics is

$$dS_t = (r - \delta_t) S_t dt + \sigma_S~S_t~d\tilde{W}_t^1$$

$$d \delta_t = \kappa (\tilde{\alpha} - \delta_t) dt + \sigma_E d\tilde{W}_t^2,$$

where $W1*, W2*$ are Brownian motions with respect to Q.

$alphaT = alpha - lambda / kappa$ where $lambda$ is the market price of convenience-yield risk. The market price of convenience yield risk can either be specified explicitly by lambda or implicitly by alphaT. The relation is alphaT = alpha - lambda / kappa. See the package vignette.

References

The Stochastic Behavior of Commodity Prices: Implications for Valuation and Hedging by Eduardo S. Schwartz Journal of Finance 52, 1997, 923-973

Valuation of Commodity Futures and Options under Stochastic Convenience Yields, Interest Rates, and Jump Diffusions in the Spot by Jimmy E. Hilliard and Jorge Reis Journal of Financial and Quantitative Analysis 33, 1998, 61-86

See Also

pricefutures, d/p/qstate, r/simstate

Examples

Run this code
# ## Create a "schwartz2f"-object
# model <- schwartz2f()
# 
# ## Probability
# pfutures(q = 10 * 3:9, time = 0.5, ttm = 2, model, lambda = 0.01)
# 
# ## Density
# dfutures(x = c(20, 40, 100), time = 0.5, ttm = 2, model, lambda = 0.01)
# 
# ## Quantile
# qfutures(p = 0.1 * 2:5, time = 0.5, ttm = 10, model, lambda = 0.01)
# 
# ## Sample
# sim <- rfutures(n = 1000, time = 0.5, ttm = 5, model, lambda = 0.01)
# 
# hist(sim, prob = TRUE)
# lines(seq(30, 300, length = 100),
#       dfutures(seq(30, 300, length = 100),
#                time = 0.5, ttm = 5, model, lambda = 0.01), col = "red")
# 
# ## At time 0 the futures price is a deterministic function of s0 and
# ## delta0. Therefore 3 times the same value is obtained:
# rfutures(3, time = 0, ttm = 1, model, lambda = 0)

Run the code above in your browser using DataLab