[PYTHON] DeepRunning ~ Level 3.2 ~

Level3. Applied mathematics ②

3-2. Probability / Statistics

・ Learning goals

(1) Deepen understanding of conditional probabilities. (2) Get an overview of Bayesian law. (3) Confirm how to obtain the expected value and variance. (4) Get an overview of various probability distributions.

3-2-1. Probability

[Frequency probability (objective probability)] ・ Frequency of occurrence ・ The fact that it was 10% when the probability of winning was investigated by drawing a lottery, etc.

[Bayesian probability (subjective probability)] ・ Degree of belief ・ Diagnosis that the possibility of influenza is 40%, etc.

3-2-2. Conditional probability

・ Probability that $ Y = y $ for a certain event under the given conditions of $ X = x $

{P\left(Y=y|X=x\right)}=\dfrac {P\left( Y=y,X=x\right)}{P\left(X=x\right)}

3-2-3. Simultaneous probability of independent events

・ Although there is no causal relationship between the occurrences of each other, it is sufficient to apply each event.

{P\left(X=x,Y=y\right)}{\quad=P\left(X=x)P(Y=y\right)}{\quad=P\left(Y=y,X=x\right)}

3-2-4. Bayesian rule

・ Generally, for event $ X = x $ and event $ Y = y $

{P\left(X=x|Y=y)P(Y=y\right)}{\quad=P\left(Y=y|X=x)P(X=x\right)}

(example)

1 daily/Get a candy ball with a probability of 4.
 {P\left(candy\right)}=\frac{1}{4}\\
When you get a candy ball 1/There is a 2 chance that you will smile.
 {P\left(Smile|candy\right)}=\frac{1}{2}\\
The probability that a child in the city is smiling is 1/It is 3.
 {P\left(Smile\right)}=\frac{1}{3}

If you organize the conditions ...

 {P\left(Smile|candy)×P(candy\right)}{=P\left(Smile,candy\right)}\\
 ⇒\quad\frac{1}{2} ×\frac{1}{4}=\frac{1}{8}\\

 \\{P\left(Smile, candy ball\right)}{=P\left(Candy, smile\right)}\\
 \\{P\left(Candy, smile\right)}{=P\left(candy|Smile)×P(Smile\right)}\\
 ⇒\quad\frac{1}{8}{=P\left(candy|Smile\right)}×\frac{1}{3}\\
  
Therefore, the probability that a smiling child in the town will receive a candy ball is\\
 {P\left(candy|Smile\right)}=\frac{3}{8}Is.\\

3-2-5. Random variables, probability distributions and expected values

[Random variable] ・ It is a numerical value associated with an event and is like a prize. ・ It is often interpreted as referring to the event itself.

[Probability distribution] ・ Distribution of probability that an event will occur (distribution of probability that a random variable will appear) ・ If it is a discrete value, it can be tabulated.

【Expected value】 ・ "Average value" and "probable value" of random variables in the distribution

Event X X_1 X_2 ・ ・ ・ X_n
Random variable f(X) f(X_1) f(X_2) ・ ・ ・ f(X_n)
Probability P(X) P(X_1) P(X_2) ・ ・ ・ P(X_n)

・ Expected value $ E (f) $

=\sum ^{n}_{k=1}P\left(X=x_k\right)f\left(X=x_k\right)

⇒ Find the expected value $ (x_k) $ with $ \ quad f (x_k) × P (x_k) $. You need to add everything together.

3-2-6. Variance and covariance

[Dispersion] ・ Scattering of one data -The average of how much each value of the data is from the expected value.

Variance $ Var (f) $

E\left( \left( f_{(X=x)} -E_{(f)}\right) ^{2}\right) =E\left( f^{2}_{\left(X=x\right) }\right) -\left( E_{(f)} \right) ^{2}

⇒ Average squared-Average squared

[Covariance] ・ Difference in the tendency of two data series ・ If a positive value is taken, the tendency is similar. ・ If a negative value is taken, the tendency is the opposite. ・ When it reaches zero, the relationship becomes poor.

Covariance $ Cov (f, g) $

E\left( \left( f_{(X=x)}-E_{(f)}\right)(g_{(Y=y)}-E_{(g)})\right)\\
=E(fg)-E(f)E(g)\\

⇒ How far is $ f $ from the average $ E (f) $? How far is $ g $ from the average $ E (g) $.

3-2-7. Various probability distributions

[Bernoulli distribution] ・ Image of coin toss ・ It can be handled even if the ratio of front and back is not equal. (Ikasama coin !!)

P(x|μ)= μ^x(1 - μ)^{1-x}

[Multi-Nui (categorical) distribution] ・ Image of rolling dice ・ It can be handled even if the proportion of each surface is not equal. (Ikasama dice !!!)

[Binomial distribution] ・ Multi-trial version of Bernoulli distribution

P(x|λ,μ)= \frac{n!}{x!(n - x)!}λ^x(1 - λ)^{n-x}

[Gaussian distribution] ・ Bell-shaped continuous distribution

N(x;μ,σ^2)= \sqrt {\dfrac {1}{2\pi\sigma^2}} exp(-\dfrac{1}{2\sigma^2}(x - μ)^2)

alt What is a deep learning course that can be crushed in the field in 3 months

Recommended Posts

DeepRunning ~ Level4.4.2 ~
DeepRunning ~ Level 4.6 ~
DeepRunning ~ Level4.3.1 ~
DeepRunning ~ Level 3.2 ~
DeepRunning ~ Level3.3 ~
DeepRunning ~ Level4.3.2 ~
DeepRunning ~ Level7 ~
DeepRunning ~ Level4.5 ~
DeepRunning ~ Level2, Level3.1 ~
DeepRunning ~ Level4.4.1 ~
DeepRunning ~ Level 1 ~
DeepRunning ~ Level 4.7 ~
DeepRunning ~ Level5 ~