Learn R Programming

schwartz97 (version 0.0.6)

mean-vcov-methods: Expected value and variance-covariance

Description

The function mean returns the expected value of the spot price and the convenience yield for some time in the future. The function vcov returns the covariance matrix of the log spot price and the convenience yield.

Usage

"mean"(x, time = 1)
"vcov"(object, time = 1)

Arguments

x, object
An object inheriting from class schwartz2f.
time
The point in time for which the mean or covariance matrix is computed. mean accepts a vector, vcov a scalar only.

Value

Either the expected value or variance-covariance matrix.

See Also

schwartz2f to create Schwartz 2 factor objects, plot to show trajectories of the state variables including means and standard deviations.

Examples

Run this code

# mean(schwartz2f(mu = 0.1), time = 1)
# 
# mean(schwartz2f(mu = 0.2), time = 0:3)
# 
# vcov(schwartz2f(), time = 10)
# 
# ## Plot a schwartz2f-object including means and standard deviations
# plot(schwartz2f(sigmaE = 0.1), n = 50, time = 5, dt = 1 / 52)

Run the code above in your browser using DataLab