marketmodel: Market Model Objects

Description Usage Arguments Details Value References See Also Examples

Description

The function marketmodel is used to create market model objects.

Usage

1
marketmodel(name, n, gamma, diffmatrix, diag = FALSE)

Arguments

name

a string which is the name of the market model (e.g. Atlas model).

n

an integer which is the number of assets in the model.

gamma

represents the instantaneous growth rates. It can be a function or a numeric vector. In the latter case the growth rates are constant.

diffmatrix

represents the diffusion matrix of the model. There are four possibilities: (i) a numeric vector, (ii) a matrix, (iii) a vector-valued function, (iv) a matrix-valued function. In cases (i) and (iii), the matrix is diagonal. The dimensions of the matrix are n times n. In the first two cases the diffusion matrix is constant.

diag

if TRUE, the diffusion matrix is diagonal. The default value is FALSE.

Details

A market model is defined by a system of stochastic differential equations (SDE) of the form

dlog X_i(t) = gamma_i(t)dt + Sigma(t) dW(t), i = 1, ..., n,

where gamma_i(t) are the growth rates (represented by gamma), Sigma is the n times n diffusion matrix (represented by diffmatrix), and W(t) is an n-dimensional standard Brownian motion. The unit of time is annual. We assume that the coefficients are functions of the X_i's, i.e., the system is Markovian. Note that the SDE are stated in terms of the logarithms of the X_i's.

The Atlas model (see AtlasModel) and the volatility-stablized market model (see VolStabModel) are predefined in the package. More general rank-based models can be constructed as marketmodel objects using this function.

The function SimMarketModel is used to simulate a market model.

At present no effort is put to check the consistency among the inputs (e.g. inconsistent dimensions).

Value

name

the name of the model.

gamma

the growth rate function.

diffmatrix

the diffusion matrix which can be a constant or a function (see above for the details).

n

the number of stocks in the model.

diag

TRUE or FALSE as supplied by the user.

References

Fernholz, E. R. (2002) Stochastic portfolio theory. Springer.

See Also

AtlasModel, SimMarketModel, VolStabModel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Create a model of two independent geometric Brownian motions
model1 <- marketmodel(name = "GBM", n = 2,
                      gamma = c(0.1, 0.05),
                      diffmatrix = c(0.1, 0.2),
                      diag = TRUE)

# Create an Atlas model of 100 stocks
model2 <- AtlasModel(n = 100, g = 0.0001, sigma = 0.1)

# Create a Volatility stabilized market of 10 stocks
model3 <- VolStabModel(n = 10, alpha = 0.001, sigma = 0.01)

Example output

Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric

RelValAnalysis documentation built on May 2, 2019, 3:09 a.m.