Application example: the amount of time a user spends on a website, the height of all the students in a class.
17.5
, and std is 1, (17.5-16)
/
1
z-score is 1.5
then we look into the table it says this value z-table is 93.38% above all the values.1.5
that means its 1.5 std above the mean and the area under the curve will always be the same.z-statistic
When population standard deviation is known we can use the z-score
When population standard deviation is unknown and we have sample greater than 30 samples, we use z-statistic for proportions only if we can assume the population is normally distributed, we use sample standard deviation in the formula, that can be proven by
<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>
−10<𝑥<10
, the range of 0<P(𝑥)<0.20
, the default values 𝜇=0
and 𝜎=1
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()
1000
linearly spaced points between (-10 to 10)
and we plot a graph for constant mean =0
and keeping varying the sigma between [2,4,6]
.