Merton.sim {CreditRisk}R Documentation

Firm value in Merton's model

Description

With this function we simulate n trajectories of firm value based on Merton's model.

Usage

Merton.sim(V0, r, sigma, t, n, seed = as.numeric(Sys.time()))

Arguments

V0

firm value at time t = 0.

r

risk-free interest rate (constant for all t).

sigma

volatility (constant for all t).

t

a vector of debt maturity structure.

n

number of trajectories to be generated.

seed

starting seed, default seed is setted randomly.

Details

The trajectories are calculated according to the equation:

V_T = V_0 \exp{\int_0^T dln V_t}

Where we express dln V_t using Ito's lemma to derive the differential of the logarithm of the firm value as:

dln V_t =(μ - \frac{σ^2}{2})dt + σ dW_t

Value

This function returns a matrix containing the simulated firm values.

References

Gergely Daròczi, Michael Puhle, Edina Berlinger, Péter Csòka, Dàniel Havran Màrton Michaletzky, Zsolt Tulasay, Kata Vàradi, Agnes Vidovics-Dancs (2013) Introduction to R for Quantitative Finance.

Examples

V <- Merton.sim(V0 = 20, r = 0.05, sigma = 0.2, t = seq(0, 30, by = 0.5), n = 5)
matplot(x = seq(0, 30, by = 0.5), y = V, type = 's', lty = 1, xlab = 'Time',
ylab = 'Firm value trajectories', main = "Trajectories of the firm values in the Merton's model")


[Package CreditRisk version 0.1.3 Index]