Computers and Technology

Background: In mathematical finance, Markov chains are used to model the default risk of a company or country (more specifically, the default of a company's or country's liability like a corporate or government bond. Rating agencies (like Standard& Poor's, Moody's, Fitch) rate the financial stability of a company and classify them according to different classes. A possible classification may range from 'AAA for debitors with a very good credit rating to 'CCC for debitors which are very likely to delay in paying a debt; and 'D' for those debitors which can't satisfy their financial labilies anymore (in other words, they are default).
The yearly credit rating of a company can be modeled as a Markov chain (X,)-0,1,2 with state space
S = AAA, AA, A, BBB, BB, B, CCc, D)
where Xn represents the credit rating class of a company in the n-th year. The transition probabilities are given by
AAA AA A BBB BB B CCC D
92.07 7.09 0.63 0.15 0.06 0.00 0.00 0.00
AA 0.62 90.84 7.76 0,59 0.06 0.10 0.02 0.01
A 0.05 2.09 91.38 5.79 0.44 0.16 0.04 0.05
BBB 0.03 0.2 4.10 89.37 4.82 0.86 0.24 0.37
BB 0.03 0.08 0.40 5.54 83.24 8.15 1.1 1.45
B 0.00 0.08 0.27 0.34 5.398 2.41 4.92 6.59
CCC 0.10 0.00 0.29 0.58 55 10.54 52.80 34.14
D 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.0
Remark: For your implementations below, you can label the different states from 0 to 7, where 0 represents state AAA, 1 represents state AA, and so on.
Write a function called simulateRating(...) which simulates the Markov chain.
Input:
startRating: Initial state of the Markov chain at time 0
numberOfSteps: Number of steps nn
P: Transition matrix
Output:
samplePath: An array of length n+1n+1 (!) with the values X0, X1Xn.
def simulateRating(startRating, numberofSteps, P):
## WRITE YOUR OWN CODE HERE
## HINT: USE np. randon. choice()
return samplePath In [ ]:
耕TEST YOUR FUNCTION HERE
simulateRating startRating - 0, numberofSteps10, PP)

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 17:00, smartoa
Annie is creating a corporate report for a company’s annual meeting. in the report, she wants to add the signature of various department heads. which device can annie use to capture signatures to include in the report? a. printer b. monitor c. e-reader d. digitizing tablet
Answers: 1
image
Computers and Technology, 23.06.2019 23:00, Maya629277
Lucas put a lot of thought into the design for his company's new white paper. he made sure to include repeating design elements such as color schemes and decorative images. his goal was to a. add symmetry b. create a unified publication c. provide consistency d. save money
Answers: 1
image
Computers and Technology, 24.06.2019 04:30, LouieHBK
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe and
Answers: 1
image
Computers and Technology, 24.06.2019 10:20, silviamgarcia
Write a program that keeps asking the user for new values to be added to a list until the user enters 'exit' ('exit' should not be added to the list). these values entered by the user are added to a list we call 'initial_list'. then write a function that takes this initial_list as input and returns another list with 3 copies of every value in the initial_list. finally, inside print out all of the values in the new list. for example: input: enter value to be added to list: a enter value to be added to list: b enter value to be added to list: c enter value to be added to list: exit output: a b c a b c a b c note how 'exit' is not added to the list. also, your program needs to be able to handle any variation of 'exit' such as 'exit', 'exit' etc. and treat them all as 'exit'.
Answers: 2
Do you know the correct answer?
Background: In mathematical finance, Markov chains are used to model the default risk of a company o...

Questions in other subjects:

Konu
Mathematics, 15.12.2020 02:20
Konu
Computers and Technology, 15.12.2020 02:20
Konu
Social Studies, 15.12.2020 02:20