zoukankan      html  css  js  c++  java
  • 多维高斯分布协方差矩阵对数据分布的影响


    % 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]);

  • 相关阅读:
    Flutter中的剪裁
    flutter设置沉浸式状态栏
    flutter设置主题色和状态栏颜色
    Flutter更改状态栏颜色
    前端基础之JavaScript
    前端基础之CSS
    前端基础之初识 HTML
    socket及其相关(续篇)
    初识socket
    面向对象及其相关
  • 原文地址:https://www.cnblogs.com/lvchaoshun/p/5906892.html
Copyright © 2011-2022 走看看