Normal Distribution

Application example: the amount of time a user spends on a website, the height of all the students in a class.

Z-score

z-statistic

Probability Density Function

<aside> 💡 The probability Density curve is not the same as the Probability of a function at (X=x). It is the integral of the probability density function.

</aside>

Plots

Probability Density Function Plot

from scipy.stats import norm
import scipy.stats as stats
import plotly.graph_objs as go
import plotly.graph_objects as go
import plotly.graph_objects as go
from plotly.subplots import make_subplots
from plotly.offline import init_notebook_mode, plot_mpl
colors=['#151515','#f0c24f']
fig = go.Figure()
x = np.linspace(-10,10,1000)
**p = norm.pdf(x, scale=2)**
fig.add_trace(go.Scatter(y=p , x=x, mode='lines+markers',marker_color=colors[1]))
fig.update_layout(title="Probability Density Function mu=0, sigma=2", 
                 legend=dict(x=.05,y=0.95, traceorder='reversed', font_size=16), 
                 width=500,
                 height=500,
                 yaxis=dict(
                          title="Probability Density Function P(x)",
                 titlefont=dict(
                          color="#1f77b4"
                                ),
                 tickfont=dict(
                        color="#1f77b4"
                               )
  ))
fig.show()

Probability Density Function with varying standard deviation