0% found this document useful (0 votes)
26 views

Risk Methodologies Examination

The document contains an exam on risk methodologies. Question 4 asks to estimate the probability of default on a portfolio of 3 loans over 12 months based on observed default data. The likelihood function is constructed based on the independence of monthly defaults. Taking the log-likelihood and finding its maximum yields an estimate of 11/12 for the probability of default in a given month.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Risk Methodologies Examination

The document contains an exam on risk methodologies. Question 4 asks to estimate the probability of default on a portfolio of 3 loans over 12 months based on observed default data. The likelihood function is constructed based on the independence of monthly defaults. Taking the log-likelihood and finding its maximum yields an estimate of 11/12 for the probability of default in a given month.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Risk Methodologies Examination

Name: Fabi´an P´erez L´opez.


Date: January 26, 2019.
Instructions:

■ The exam must be completed in less than 60 minutes.

■ Answer what is asked for in each point, including any assumptions used. If you don't know a definition for
questions 4 and 5, make it up, define it, and use it according to its definition.

■ A number is not worth an answer if the logic used is not included.

Question 1 Formal definition of the derivative of a function f. The function f is differentiable in a if

f(a+h) -f(a) lım


h→0 h exists.

In this case the limit is designated by f (a) and is called the derivative of f in a. We also say that f is differentiable
0

if f is differentiable in a for all a in the domain of f.

Question 2 Intuitively (not formally), what does the second derivative of a function represent? As an informal
review, we say that a function f is convex on an interval, if for all a and b of this interval, the rectilinear segment
that joins (a, f (a)) with (b, f (b )) is above the graph of f (∪-shaped graph); The function f is concave if said
rectilinear segment is below the graph of f (∩-shaped graph). Thus, if f > 0 it means that f is increasing, and by
00 0

theorems of elementary calculus, f is convex. Otherwise, if f < 0, f is decreasing and therefore f is concave.
00 0

This is what the second derivative of a function f represents. An important use of the second derivative in locating
maxima and minima is the following theorem, which we state formally.
Suppose f (a) = 0. If f (a) > 0, then f has a local minimum at a; if f (a) < 0, then f has a local maximum at a.
0 00 00

Question 3 What is a likelihood function and what is its use in parameter estimation? Prior to the answer, the
reader is put in context for a better understanding of the definition that will be given shortly.
An F-statistical model is a set of distributions (or densities or regression functions). A parametric model is a set F
that can be parameterized by a finite number of parameters. For example, if we assume that the data come from
a nor distribution wrong, then the model is

F = f (x; µ, σ) = σ√2π exp - 2σ (x-µ)


2
2
: µ ∈ R, σ > 0 .

This is a two-parameter model. We have written the density as f (x; µ, σ) to show that x is a value of the random
variable, while µ and σ are parameters. In general, a parametric model takes the form

F = {f(x; θ) : θ ∈ Θ}

where θ is an unknown parameter (or vector of parameters) that can take values in the parameter space Θ.
Essentially, the maximum likelihood principle assumes that the sample is representative of the population and
chooses as the estimator the value of the parameter that maximizes the probability density function (hereinafter
pdf) f(x; θ ). Below we give the definition of the likelihood function.
Let (X 1 , . . . , X n ) a random vector with pdf f (x 1 , . . . , x n ; θ), θ ∈ Θ. The function

L(θ; x 1 , . . . , x n ) = f(x 1 , . . . , x n ; θ)

1
considered as a function of θ, it is called the likelihood function.
If X , . . . , X are independent and identically distributed (hereinafter iid) with pdf f (x; θ), the likelihood function is
1 n

L(θ; x 1 , . . . , x n ) = f(x i ; θ).


i=1

On the other hand, let Θ ⊆ R and X = (X , . . . , X ). The likelihood function is used to, from it, find an estimator
k
1 n

Θ(X) that maximizes it, that is, find a function Θ ˆ : R → R that satisfies
n k

L(θ; x , . . . , x ) = sup L(θ; x , . . . ,x ).


1 n 1 n (1)
θ∈Θ

Constants are not supported as estimators. If a θ that satisfies (1) exists, we call it maximum likelihood estimator
(hereinafter MLE).

Question 4 You have a credit portfolio, the portfolio is composed only of 3 credits at a certain reference date f 1
and you know that all the credits have a maturity less than or equal to one year either; This portfolio is monitored
during the 12 months following the reference date and the following distribution of defaults is observed:

■ Credit 1 does not default,

■ Credit 2 defaults in month 11,

■ Credit 3 defaults in months 4 and 9 (defaults 2 times in the year).

With the above information, obtain the best possible estimate of the probability that a loan will default in the next
year.
As mentioned in problem 3, the maximum likelihood principle assumes that the sample is representative of the
population and chooses as the estimator the value of the parameter that maximizes af (x; θ). It is assumed that
the monthly payments of each credit are independent.
Consider the random variable X ij = 0 if loan i defaults in month j (i = 1, . . . , 3, j = 1, . . . , 12) or X j = 1 if loan i is
i

due in month j; Let p denote the probability of fulfilling or paying. Then, we write the likelihood function according
to the sample of payoffs that the problem provides (X = (X 11 . . . , X 3 12 )).

2
3 12
L(p,X) = YY p x ij
(1 - p) 1-x ij

i=1 j=1
= p (1 - p) p (1 - p) p (1 - p)
12 0 11 1 10 2

= p (1 - p) .33 3

Observing that maximizing L(p, X) is equivalent to maximizing log(L(p,

log(L(p, X)) = log(p (1 - p) ) 33 3

= 33 log(p) + 3 log(1 - p).

Therefore
d
(log(L(p,X)))= 33 - 3

dp p1-p (2)

So
d
d
(log(L(p, X))) = dp
↔ 0
33 3
p 1p

p= 0
1p

33
p=
3

Therefore, the probability that a loan defaults next year is 11


11 1 12 .
1-p=1- .
12 12
In order to confirm that p = 1
is a maximum for the likelihood function and appealing to the theorem mentioned
1
1
2

at the end of problem 2, we derive equation (2) once again.

d
2
33 3
(log(L(p, X))) dp
p 2
(1 - p) 2

= - / 33 3N
p 2
(1 - p) 2

< 0 ∀p ∈ (0, 1).

In particular, this derivative is negative for p = 1


1
1
2 , thus confirming that this value is a maximum for the likelihood
function stated previously.

Question 5 It is known that the probability that a loan with a maturity of 6 months falls pla in the next 6 months is p
1 (0 < p 1 < 1), what is the probability that this loan will default in the next year?

Question 5 It is known that the probability of a loan maturing in 6 months defaulting in the next 6 months is p (0 <
p < 1). What is the probability that this loan will default in the next year?
I suppose it has to do with issues of probability of default; It has not been possible for me to model it as such.

Question 6 We have 2 vectors x and y, such that

3
[x 1 , . . . , x n ] [y , . . . , and ]
1 m

where m and n are different positive integers, both vectors are ordered so that x ≤ x 2 ≤ . . . ≤ x n yy 1 ≤ y 2 ≤ . . . ≤
1

and m . Create a pseudocode to join both vectors into a single vector w that contains both vectors ordered in
ascending order, that is, w = [w 1 , w 2 , . . . , w m+n ] such that w i is an element of x or i is an element of y.
Furthermore, the vector w must satisfy that w ≤ w ≤ . . . w . Hint: Uses the fact that both vectors are ordered.
1 2 m+n

Define and initialize vector w of length m+n


w = (0,...,0)

Initialize counters i and j


i=1
j=1

while(i <= length(x) and j <= length(y))


{
if(x[i] <= y[j])
{
w[i+j-1] = x[i] Assign value to input i+j-1
i = i + 1 Increment counter

otherwise

w[i+j-1] = y[j] j=j+1

The values that were possibly left over are added to w given that the two vectors, x and y, are of different lengths.
Since the x and y vectors were already sorted, these remaining values no longer need to be sorted.

while(i <= length(x))


{
w[i+j-1] = x[i] i=i+1
}

while(j <= length(y))


{
w[i+j-1] = y[j]
j=j+1
}

You might also like