CreditRisk (version 0.1.0)

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

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.

Value

This function returns a matrix containing the simulated firm values.

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<U+00F2>czi, Michael Puhle, Edina Berlinger, P<U+00E9>ter Cs<U+00F2>ka, D<U+00E0>niel Havran M<U+00E0>rton Michaletzky, Zsolt Tulasay, Kata V<U+00E0>radi, Agnes Vidovics-Dancs (2013) Introduction to R for Quantitative Finance.

Examples

Run this code
# NOT RUN {
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 DataCamp Workspace