Mathematics in Finance: Probability Distribution (Part 1)

A probability distribution is a function that describes the probabilities of possible values ​​that a random variable can take. It can be used to describe the probability distribution of both discrete and continuous variables. For probability distributions of discrete variables, we call them discrete probability distributions . For a probability distribution of a continuous variable, we call it a continuous probability distribution . This article focuses on discrete probability distributions.

1. Discrete uniform distribution

A discrete uniform distribution is a probability distribution that describes the possible values ​​of a discrete variable, where each value is equally likely. In a discrete uniform distribution, the range of values ​​a variable can take is finite and continuous.

The probability mass function of the discrete uniform distribution is as follows:

Among them, X represents the value of the random variable, x represents any specific value within the value range, and N represents the number of elements within the value range.

An example to illustrate the discrete uniform distribution: Suppose there is a dice with 6 sides, labeled with numbers 1 to 6. The occurrence probability of each face is equal, that is, P(X = 1) = P(X = 2) = P(X = 3) = P(X = 4) = P(X = 5) = P(X = 6) = 1/6. This is a discrete uniform distribution.

It should be noted that the discrete uniform distribution is only applicable to a limited range of values. If the value range is infinite, it is necessary to use a continuous uniform distribution to describe the probability distribution.

A discrete uniform distribution can be created using the following python code:

import random
print(random.randint(0,9))

2. Binomial distribution

The binomial distribution is a probability distribution that describes the number of successes of a discrete random variable in a fixed number of independent repeated trials. On each trial, a random variable has only two possible outcomes, usually denoted success (S) and failure (F). where the probability of success is p and the probability of failure is 1-p (or q = 1-p).

The probability mass function (PMF) of the binomial distribution can be expressed as:

Among them, X represents the value of the random variable, k represents the number of successes, n represents the total number of independent experiments, C(n, k) represents the number of combinations (that is, the number of successful combinations of k times from n trials), p Represents the probability of success for each experiment, and (1-p)^(nk) represents the probability of failure.

The binomial distribution is often used to describe experiments and events with binary outcomes, such as coin tosses, sample surveys, defective rates on a production line, etc. It is one of the most fundamental probability distributions in probability theory and statistics and has wide applications in many fields.

A binomial distribution can be created using the following python code:

from numpy import randaom
x=random.binomial(n=10,p=0.9)
print(x)

3. Poisson distribution

The Poisson distribution is a probability distribution that describes the random occurrence of events in a fixed time or space region. The Poisson distribution is suitable for describing the probability of the number of occurrences of an event, such as the number of accidents occurring within a period of time, the number of telephone calls occurring within a certain area, etc.

The probability mass function (PMF) of the Poisson distribution can be expressed as:

Among them, X represents the value of the random variable, k represents the number of events occurring, λ represents the average number of events occurring in a given time or space area, e is the base of natural logarithm (approximately equal to 2.71828), k! represents k of factorial.

The characteristics of the Poisson distribution include:
1. The occurrence of events in any two non-overlapping regions of time or space is independent.
2. In the same time or space region, the probability of occurrence of events is equal in region size.
3. The number of occurrences of the event is discrete, and the value range is a non-negative integer (0, 1, 2, ...).

The Poisson distribution is often used to describe the statistical distribution of rare or low-occurrence events, especially when the average number of events occurring is fixed and relatively small. For example, the Poisson distribution can be used to estimate the number of traffic accidents, machine breakdowns, phone calls, etc. that occur each day.

In python, you can use the following code to generate a Poisson distribution

from numpy import random
x=random.poisson(lam=2,size=10)
print(x)

Guess you like

Origin blog.csdn.net/m0_64087341/article/details/131775472