多维高斯分布协方差矩阵对数据分布的影响
2016-01-15 09:32
302 查看
% Plot the first dataset (case #1)
m=[0 0]';
S=[1 0;0 1];
N=500;
X = mvnrnd(m,S,N)';
subplot(2,4,1)
plot(X(1,:),X(2,:),'.'),title('1 0;0 1'),axis equal,axis([-7 7 -7 7]);
% Generate and plot the second dataset (case #2)
m=[0 0]';
S=[0.2 0;0 0.2];
N=500;
X = mvnrnd(m,S,N)';
subplot(2,4,2)
plot(X(1,:),X(2,:),'.'),title('0.2 0;0 0.2'),axis equal,axis([-7 7 -7 7]);
% Generate and plot the third dataset (case #3)
m=[0 0]';
S=[2 0;0 2];
N=500;
X = mvnrnd(m,S,N)';
subplot(2,4,3)
plot(X(1,:),X(2,:),'.'),title('2 0;0 2'),axis equal,axis([-7 7 -7 7]);
% Generate and plot the fourth dataset (case #4)
m=[0 0]';
S=[0.2 0;0 2];
N=500;
X = mvnrnd(m,S,N)';
subplot(2,4,4)
plot(X(1,:),X(2,:),'.'),title('0.2 0;0 2'),axis equal,axis([-7 7 -7 7]);
% Generate and plot the fifth dataset (case #5)
m=[0 0]';
S=[2 0;0 0.2];
N=500;
X = mvnrnd(m,S,N)';
subplot(2,4,5)
plot(X(1,:),X(2,:),'.'),title('2 0;0 0.2'),axis equal,axis([-7 7 -7 7]);
% Generate and plot the sixth dataset (case #6)
m=[0 0]';
S=[1 0.5;0.5 1];
N=500;
X = mvnrnd(m,S,N)';
subplot(2,4,6)
plot(X(1,:),X(2,:),'.'),title('1 0.5;0.5 1'),axis equal,axis([-7 7 -7 7]);
% Generate and plot the seventh dataset (case #7)
m=[0 0]';
S=[.3 0.5;0.5 2];
N=500;
X = mvnrnd(m,S,N)';
subplot(2,4,7)
plot(X(1,:),X(2,:),'.'),title('.3 0.5;0.5 2'),axis equal,axis([-7 7 -7 7]);
% Generate and plot the eighth dataset (case #8)
m=[0 0]';
S=[.3 -0.5;-0.5 2];
N=500;
X = mvnrnd(m,S,N)';
subplot(2,4,8)
plot(X(1,:),X(2,:),'.'),title('.3 -0.5;-0.5 2'),axis equal,axis([-7 7 -7 7]);
相关文章推荐
- Git(3)基础操作
- 函数时间转换
- sqlite3常用的c语言函数接口
- proc相关操作
- Excel导出工具类
- Git(2)安装Git
- idea功能attach source
- Oracle内根据上一行总数和本行新增数计算本行总数
- iOS 推送 获取手机设备的 deviceToken
- iOS 【Multithreading-创建线程的方式/线程状态(了解)】
- Web Storage存储
- poj3164Command Network
- MyBATIS使用CRUD
- c 语言结构体struct的三种定义方式 及 typedef
- 三极管实用
- iOS捕获异常,常用的异常处理方法
- sklearn 中的 Pipeline 机制
- codeforces 616E - Sum of Remainders
- 写给年轻程序员的一封信
- 窥探Swift系列博客说明及其Swift版本间更新