python笔记:6.2.1.1单总体均值参数估计_画正态分布图

 

# -*- coding: utf-8 -*-
"""
Created on Tue Jun 11 20:00:42 2019

@author: User
"""

import numpy as np
import pandas as pd
#from scipy import stats
#import statsmodels.api as sm
import matplotlib.pyplot as plt

u = 0   # 均值μ
sig = np.sqrt(0.2)  # 标准差δ
x = np.linspace(u - 3*sig, u + 3*sig, 50)
y_sig = np.exp(-(x - u) ** 2 /(2* sig **2))/(np.sqrt(2*np.pi)*sig)
plt.plot(x, y_sig, "r-", linewidth=2)
plt.grid(True)
plt.show()

运行:

python笔记:6.2.1.1单总体均值参数估计_画正态分布图_第1张图片

你可能感兴趣的:(python学习)