CreditRisk (version 0.1.7)

Merton.sim: 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()))

Value

This function returns a matrix containing the simulated firm values.

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 =(\mu - \frac{\sigma^2}{2})dt + \sigma dW_t$$

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

Run this code
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")

Run the code above in your browser using DataLab