1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
-BARSIC- [3]
3 years ago
9

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, X1.....Xn.
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)
Computers and Technology
1 answer:
Aleksandr [31]3 years ago
4 0

Answer: Provided in the explanation section

Explanation:

All  explanation to the code below are provided in the code comments

Code:

import numpy as np

# transition probability matrix

# copy all the values given

P = np.array([[92.07, 7.09, 0.63, 0.15, 0.06, 0.00, 0.00, 0.00],

[0.62, 90.84, 7.76, 0.59, 0.06, 0.10, 0.02, 0.01],

[0.05, 2.09, 91.38, 5.79, 0.44, 0.16, 0.04, 0.05],

[0.03, 0.21, 4.10, 89.37, 4.82, 0.86, 0.24, 0.37],

[0.03, 0.08, 0.40, 5.54, 83.24, 8.15, 1.11, 1.45],

[0.00, 0.08, 0.27, 0.34, 5.39, 82.41, 4.92, 6.59],

[0.10, 0.00, 0.29, 0.58, 1.55, 10.54, 52.80, 34.14],

[0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 100.0]])

print('Transition probability matrix:')

print(P)

print()

# probability transition for state 3

# extract 4th row for index 3

P3 = P[3]

print('Probability transition for state 3:')

print(P3)

print()

# probability that AAA company will not default in next 8 years

# for next 8 years, transition probabilities = P^8

P_next8 = np.linalg.matrix_power(P, 8)

# now get probability for transition from AAA to D

# and subtract it from 100 to get not default

P_next8_not_default = (100**8 - P_next8[0][7]) * 100 / 100**8

print('Probability that company rated AAA will not default in next 8 years:', P_next8_not_default)

cheers i hope this helps !!!

You might be interested in
152<br>what is the role of Computer as<br>transforming agent in the<br>Information society.​
hichkok12 [17]
I have a question what grade are you in
8 0
3 years ago
Some people use the term _____ to refer to the case that contains and protects the motherboard, internal hard drive, memory, and
Volgvan

Answer:

System unit.

Explanation:

Some people use the term system unit to refer to the case that contains and protects the motherboard, internal hard drive, memory, and other electronic components of the computer from damage.

A system unit also referred to as chassis or tower can be defined as a hardware case that is typically used as a protective case for the main component or primary devices such as power supply, random access memory (RAM), graphics card, CD-ROM drive, Harddisk drive, motherboard, internal cables, central processing unit (CPU) that makes up a computer system.

Basically, the main purpose of a system unit is to properly house the main components of a computer, serve as an electrical insulator and to prevent them from any form of damage.

7 0
3 years ago
An isp is a group of updates, patches, and fixes that apply to specific oss.
olasank [31]
<span>The statement that an ISP is a group of updates, patches, and fixes that apply to specific OSs is false.
</span> ISP stands for Internet service provider, while OSS stands for Operations support system.<span> The term ISP denotes a company or</span><span> organization that provides services for accessing, using, or participating in the Internet. OSS on the other hand is used by the providers to manage their networks.
</span>
4 0
3 years ago
Differences between mechanical and optical mouse <br>Plz help me
lutik1710 [3]
Mechanical mouse has a ball that turns rollers inside. If friction is lost between the ball and the mousing surface, or between the ball and the rollers, the mouse fails to work. In order to assure good contact with the mousing surface, the ball must be fairly heavy. When you change directions with the mouse, you must make the ball change rolling directions--an action that inertia likes to prevent.

An optical mouse makes use of an LED and some optics to detect surface texture and the changes in it as the mouse is moved. There are no moving parts
7 0
4 years ago
Which program can damage your computer? can cause damage to my computer.
svetlana [45]

Answer:

Malware is designed to cause damage to a stand alone computer or a networked pc. So wherever a malware term is used it means a program which is designed to damage your computer it may be a virus, worm or Trojan.

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • Dfd symbols are referenced by using all ____ letters for the symbol name.
    9·1 answer
  • Is this photo considered rim photography
    11·1 answer
  • Survey Q. Non-scoring: What role is played in the team? (1 correct answer)
    14·1 answer
  • The OSI model is a useful tool in troubleshooting a network because it enables you to isolate a problem to a particular software
    11·1 answer
  • Which key(s) will launch the Spelling Checker dialog box? F8 F7 Ctrl+H F2
    11·2 answers
  • Pig Latin is ______ and fits very naturally in the pipeline paradigm while SQL is instead declarative.
    7·1 answer
  • I’ll mark brainliest, thanks
    10·2 answers
  • 1
    13·1 answer
  • What is a case in programming​
    12·1 answer
  • How to make a Java GUI application? Discuss each step needed.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!