clear
clc
% Load data
data = load('data.txt');
epd(data)
mu = mean(data);
sigma = std(data);
x = min(data):.1:max(data);
y = normpdf(x,mu,sigma);
hold on
plot(x,y)
legend('empirical density function','standard normal density')
% plot empirical probability density function
function epd(x)
colormap([0.5 0.4 .6])
%%%%%%%%%%%%%%%% Histogram %%%%%%%%%%%%%%%%%%%
M=length(x);
xmax=max(x);
xmin=min(x);
dx=(xmax-xmin)/30;
centers = [xmin:dx:xmax];
N= hist(x,centers);
%bar(centers,N/(M*dx));
%hold on
plot(centers,N/(M*dx),'r-')
红线对应你所说的1所画的曲线图,蓝线对应2所画的标准正态分布曲线图。
其实看是否存在“尖峰厚尾”,主要看峰度是否大于3.