Learn R Programming

schwartz97 (version 0.0.6)

schwartz2f-constructor: Create schwartz2f objects

Description

Create objects of class schwartz2f.

Usage

schwartz2f(s0 = 100, delta0 = 0, mu = 0.1, sigmaS = 0.3, kappa = 1, alpha = 0, sigmaE = 0.3, rho = 0.5)

Arguments

s0
Initial value of the commodity spot price.
delta0
Initial value of the convenience yield.
mu
enters the drift of the 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.

Value

An object of class schwartz2f.

Details

The dynamics of the Schwartz two-factor model is explained in the schwartz2f class documentation or in the package vignette in the doc-folder.

References

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

See Also

fit.schwartz2f for parameter estimation. d/p/q/r/simstate for the density, distribution, and quantile function of the state variables and random number generation. plot-method for schwartz2f-objects.

Examples

Run this code

# ## Initialize a 'schwartz2f' object with high convenience yield volatility:
# obj <- schwartz2f(sigmaE = 0.7)
# 
# plot(obj) # plot it
# 
# rstate(10, time = 1, s0 = obj) # generate 10 random variates.
# 
# ## Get the probability of the event 'the spot price is >= 100 and the
# ## convenience yield is >= 0':
# pstate(c(0, -Inf), c(100, 0), time = 10, s0 = obj) 

Run the code above in your browser using DataLab