Last data update: 2014.03.03

R: Expected value and variance-covariance
mean-vcov-methodsR Documentation

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


## S4 method for signature 'schwartz2f'
mean(x, time = 1)

## S4 method for signature 'schwartz2f'
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.

Note

vcov returns the variance-covariance matrix of [log spot price, convenience yield](time).

Author(s)

David Luethi

See Also

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

Examples


# 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)

Results