- Level: University Degree
- Subject: Mathematical and Computer Sciences
- Word count: 3564
Stochastic Applications of Actuarial Models with R coding
Extracts from this document...
Introduction
Part I
Introduction
Credit risk refers to the probability that the counterparty may not meet its contractual obligations. Bond rating is a good indicator of credit risk of a sovereign issuing the bonds. Thus it is important to analyse the possible future rating movements of a sovereign due to credit events.
1. Probability of Default Rating
To model the credit risks of bonds over time, a continuous time Markov model is implemented to calculate the probability of credit migration. In using a continuous time Markov model, the Kolmogorov forward equations are used:
where Pij(t) is the transition probability from rating i to rating j at time t, and rkj refers to the transition rates from rating k to rating j based on the annual transition rates matrix estimated. The above equation can be rewritten in matrix form, where P(t) is the matrix of transition probabilities over time t, and R is the annual transition rate matrix estimated.
A possible solution to the above equation is, where P(0) is the matrix of initial transition probabilities. It is assumed that the sovereign will remain in their current rating initially (at t=0), so for all ratings the probability of transition from one rating to another will be zero at time 0, while probability of remaining in the same rating is 1 (implying that P(0) is the identity matrix).
To observe the probability of default over time for sovereign rated AAA, AA, A and B, the probability transition matrix will be calculated for 100 equally spaced time frames over a 10 year period (starting from beginning of year 1995 to end of year 2004), The probability transition matrix
Middle
0.03489511
It can be observed that the probability of a sovereign initially rated BB or above being rated default increases over time, due to greater time frame for credit events and hence rating migration to occur. Also the increase in transition rate matrix means that there will be more transitions between credit ratings, meaning sovereigns starting from a rating close to default are more likely to move upwards than usual.
Part II
1. a) Consider the stock price modelled by the geometric Brownian motion process:
For each of the 2 methods suggested, we simulated S(t) for t=150000 with increments of 1/12 for time and then calculated ln(S(t))/t for each value of t.
It can be noted from the above results, both methods will cause the function ln(S(t))/t will converge to the limit which is approximately 0.0558077, which is close to the true value of p of 0.055. The true value can be found based on the property of the probability distribution of ln(S(t)).
We note that: as S(0)=1, , and
Using the Delta Method, we can deduce the distribution of ln(S(t))/t as:
Taking limits as t goes towards infinity, we note that:
So as t goes to infinity, the variance will reduce to 0, meaning ln(S(t))/t will approach the mean which is 0.055. Thus the true value of p is 0.055 and verified the results of the simulation.
b) To find the value of t to obtain 2 digit accuracy with 95% probability, we find t such that:
This is equivalent to finding:
Rearranging gives
Noting that from part a) that , where p=v, we can deduce that . This implies that , and noting that and , we deduce that .
Conclusion
Plots function for 1(a) Method 2
plot(Q2, type="l", lwd=3, xlab="Time", ylab="(ln[S(t)])/t", main="Result from Method 1")
>Q1[150000] = 0.0558077 ←Used as an estimate of the limit
Plots function for 1(c) Method 1
plot(P1, type="l", lwd=3, xlab="Time", ylab="((ln[S(t)]-p)^2)/t", main="Result from Method 1")
Plots function for 1(c) Method 2
plot(P2, type="l", lwd=3, xlab="Time", ylab="((ln[S(t)]-p)^2)/t", main="Result from Method 2")
2.1.2 – Derivation of Gamma distribution of the function
Consider and hence . So:
Let , so then:
by noting the cumulative distribution function of standard normal
Thus the probability density function of can be found by differentiating with respect to x. Using the Fundamental theorem of calculus, this gives:
where , which is in the form of distribution.
2.2 Part II Question 2
Code is in Blue
Results are in Red
Comments are in Green
Collects the exchange rate data from a CSV file
exchange <- read.csv("C:/Users/Chung-Yu/Documents/Uni/Actuarial Studies/ACTL2003/Assignment/exchange.csv",header=T)
exchange<-ts(exchange[,1],start=1980,freq=365/7)
Plots time series of data as well as sample ACF and PACF
par(mfrow=c(2,2))
plot(exchange)
acf(exchange)
acf(exchange, type="partial")
Plots the differenced data
par(mfrow=c(2,2))
plot(diff(exchange))
acf(diff(exchange))
acf(diff(exchange), type="partial")
fit=arima(exchange, order=c(0,1,0)) fit ARIMA(0,1,0) model
tsdiag(fit) Shows residual plots for fitted ARIMA(0,1,0) model, used for residual analysis
> fit=arima(exchange, order=c(0,1,0))
> fit
Shows AIC for ARIMA(0,1,0) model
Call:
arima(x = exchange, order = c(0, 1, 0))
sigma^2 estimated as 0.0007593: log likelihood = 1018.97, aic = -2035.93
The next 2 ARIMA models are fitted to compare the AIC and to see that the AIC for ARIMA(0,1,0) is optimal.
> fit=arima(exchange, order=c(0,1,1))
> fit
Call:
arima(x = exchange, order = c(0, 1, 1))
Coefficients:
ma1
-0.0610
s.e. 0.0449
sigma^2 estimated as 0.0007563: log likelihood = 1019.87, aic = -2035.74
> fit=arima(exchange, order=c(1,1,0))
> fit
Call:
arima(x = exchange, order = c(1, 1, 0))
Coefficients:
ar1
-0.0629
s.e. 0.0461
sigma^2 estimated as 0.0007563: log likelihood = 1019.89, aic = -2035.79
This student written piece of work is one of many that can be found in our University Degree Statistics section.
Found what you're looking for?
- Start learning 29% faster today
- 150,000+ documents available
- Just £6.99 a month