Learn R Programming

schwartz97 (version 0.0.6)

schwartz2f-class-hierarchy: Classes schwartz2f and schwartz2f.fit

Description

The schwartz2f class stores parameters which determine initial values and the dynamics of the state variables. The class schwartz2f.fit inherits from the schwartz2f class. The class schwartz2f.fit adds slots which contain data regarding the estimation procedure and parameters of the risk-neutral dynamics. In particular, it adds the market price of convenience yield risk lambda and the interest rate.

Arguments

Objects from the Class

Objects should only be created by calls to the constructors schwartz2f and fit.schwartz2f.

Slots

Slots of class “schwartz2f”:
call:
The function-call of class call.
s0:
Initial commodity spot-price of class numeric.
delta0:
Initial value of the convenience yield of class numeric.
mu:
Enters the drift of the commodity spot price (under the objective measure, see Details) of class numeric.
sigmaS:
Diffusion parameter of the spot price process of class numeric.
kappaE:
Speed of mean-reversion of the convenience-yield process of class numeric.
alpha:
Mean level of the convenience-yield process of class numeric.
sigmaE:
Diffusion parameter of the convenience-yield process of class numeric.
rhoSE:
Correlation between the two Brownian motions which drive the spot price and convenience-yield processes of class numeric.
Slots added by class “schwartz2f.fit”:
n.iter:
The number of iterations of class numeric.
llh:
The log likelihood value of class numeric.
converged:
A logical stating whether the fit converged or not.
error.code:
An error code of class numeric. The value of optim's “convergence”. If an unknown error occurs the value -1 is returned.
error.message:
An error message of class character, if any.
fitted.params:
A logical vector stating which parameters were fitted.
trace.pars:
Contains the parameter value evolution during the estimation procedure of class matrix.
r:
The risk-free interest rate of class numeric.
alphaT:
The mean-value of the convenience yield process under the equivalent martingale measure of class numeric (see Details).
lambda:
The market price of convenience yield risk of class numeric.
meas.sd:
The standard deviation of the measurement equantion of class numeric.
deltat:
The time-increment of the transition equation of class numeric.

Details

The joint dynamics of the spot-price and the convenience yield are given by the stochastic differential equations $$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. Under an equivalent martingale measure (the pricing measure) the 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 the martingale measure. $alphaT = alpha - lambda / kappa$ where $lambda$ is the market price of convenience-yield risk.

Extends

Class “schwartz2f.fit” extends class “schwart2factor”, directly.

References

Stochastic Convenience Yield and the Pricing of Oil Contingent Claims by Rajna Gibson and Eduardo S. Schwartz The Journal of Finance 45, 1990, 959-976

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

Pricing of Options on Commodity Futures with Stochastic Term Structures of Convenience Yields and Interest Rates by Kristian R. Miltersen and Eduardo S. Schwartz Journal of Financial and Quantitative Analysis 33, 1998, 33-59

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

schwartz2f to initialize schwartz2f-objects. fit.schwartz2f to fit the two-factor model to data and get a schwartz2f.fit object, schwartz97-package for an overview.

Examples

Run this code

# obj <- schwartz2f() # create an object of class schwartz2f
# obj          # print it
# coef(obj)    # get coefficients 
# unclass(obj) # see the slots 
# 
# ## create an object of class schwartz2f.fit
# data(futures)
# fit.obj <- fit.schwartz2f(futures$wheat$price, futures$wheat$ttm / 260,
#                           deltat = 1 / 260, control = list(maxit = 3))
# fit.obj          # print it
# coef(fit.obj)    # get coefficients 
# unclass(fit.obj) # see the slots 

Run the code above in your browser using DataLab