Jump to content
Wikipedia The Free Encyclopedia

File:Multivariate normal sample.svg

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Original file (SVG file, nominally 663 ×ばつ 500 pixels, file size: 3.14 MB)
This is a file from the Wikimedia Commons. Information from its description page there is shown below.
Commons is a freely licensed media file repository. You can help.

Summary

DescriptionMultivariate normal sample.svg
English: An SVG version of File:MultivariateNormal.png
Date
Source Own work
Author IkamusumeFan
Other versions

Matlab script source

%Author: Bscan
%This script illustrates a multivariate Gaussian distribution and its
%marginal distributions

%This code is issued under the CC0 "license"

%Define limits of plotting
X=-5:0.1:5;
Y=-5:0.1:5;

%2-d Mean and covariance matrix
MeanVec=[00];
CovMatrix=[10.6;0.62];

%Get the 1-d PDFs for the "walls"
Z_x=normpdf(X,MeanVec(1),sqrt(CovMatrix(1,1)));
Z_y=normpdf(Y,MeanVec(2),sqrt(CovMatrix(2,2)));

%Get the 2-d samples for the "floor"
Samples=mvnrnd(MeanVec,CovMatrix,10000);

%Get the sigma ellipses by transform a circle by the cholesky decomp
L=chol(CovMatrix,'lower');
t=linspace(0,2*pi,100);%Our ellipse will have 100 points on it
set(0,'DefaultAxesFontName','Times New Roman')
set(0,'DefaultAxesFontSize',36)
C=[cos(t);sin(t)];%A unit circle
E1=1*L*C;E2=2*L*C;E3=3*L*C;%Get the 1,2, and 3-sigma ellipses

figure;holdon;
%Plot the samples on the "floor"
plot3(Samples(:,1),Samples(:,2),zeros(size(Samples,1),1),'k.','MarkerSize',2)
%Plot the 1,2, and 3-sigma ellipses slightly above the floor
%plot3(E1(1,:), E1(2,:), 1e-3+zeros(1,size(E1,2)),'Color','g','LineWidth',2);
%plot3(E2(1,:), E2(2,:), 1e-3+zeros(1,size(E2,2)),'Color','g','LineWidth',2);
plot3(E3(1,:),E3(2,:),1e-3+zeros(1,size(E3,2)),'Color','g','LineWidth',2);

%Plot the histograms on the walls from the data in the middle
[n_x,xout]=hist(Samples(:,1),20);%Creates 20 bars
n_x=n_x./(sum(n_x)*(xout(2)-xout(1)));%Normalizes to be a pdf
[~,~,~,x_Pos,x_Height]=makebars(xout,n_x);%Creates the bar points
plot3(x_Pos,Y(end)*ones(size(x_Pos)),x_Height,'-k')

%Now plot the other histograms on the wall
[n_y,yout]=hist(Samples(:,2),20);
n_y=n_y./(sum(n_y)*(yout(2)-yout(1)));
[~,~,~,y_Pos,y_Height]=makebars(yout,n_y);
plot3(X(1)*ones(size(y_Pos)),y_Pos,y_Height,'-k')

%Now plot the 1-d pdfs over the histograms
plot3(X,ones(size(X))*Y(end),Z_x,'-b','LineWidth',2);
plot3(ones(size(Y))*X(1),Y,Z_y,'-r','LineWidth',2);

%Make the figure look nice
gridon;view(45,55);
axis([X(1)X(end)Y(1)Y(end)])
print-depscmultivariate_normal_sample.eps

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
https://creativecommons.org/licenses/by-sa/3.0CC BY-SA 3.0 Creative Commons Attribution-Share Alike 3.0 truetrue
Annotations
InfoField
This image is annotated: View the annotations at Commons
141
370
8
8
663
500

X {\displaystyle X} {\displaystyle X}

536
364
8
8
663
500

Y {\displaystyle Y} {\displaystyle Y}

257
85
8
8
663
500

p ( Y ) {\displaystyle p(Y)} {\displaystyle p(Y)}

535
105
8
8
663
500

p ( X ) {\displaystyle p(X)} {\displaystyle p(X)}

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

copyright status<\/a>"}},"text\/plain":{"en":{"":"copyright status"}}},"{\"value\":{\"entity-type\":\"item\",\"numeric-id\":50423863,\"id\":\"Q50423863\"},\"type\":\"wikibase-entityid\"}":{"text\/html":{"en":{"P6216":"copyrighted<\/a>"}},"text\/plain":{"en":{"P6216":"copyrighted"}}}}" class="wbmi-entityview-statementsGroup wbmi-entityview-statementsGroup-P6216 oo-ui-layout oo-ui-panelLayout oo-ui-panelLayout-framed">
inception<\/a>"}},"text\/plain":{"en":{"":"inception"}}},"{\"value\":{\"time\":\"+2014年01月01日T00:00:00Z\",\"timezone\":0,\"before\":0,\"after\":0,\"precision\":11,\"calendarmodel\":\"http:\\\/\\\/www.wikidata.org\\\/entity\\\/Q1985727\"},\"type\":\"time\"}":{"text\/html":{"en":{"P571":"1 January 2014"}},"text\/plain":{"en":{"P571":"1 January 2014"}}}}" class="wbmi-entityview-statementsGroup wbmi-entityview-statementsGroup-P571 oo-ui-layout oo-ui-panelLayout oo-ui-panelLayout-framed">

1 January 2014

source of file<\/a>"}},"text\/plain":{"en":{"":"source of file"}}},"{\"value\":{\"entity-type\":\"item\",\"numeric-id\":66458942,\"id\":\"Q66458942\"},\"type\":\"wikibase-entityid\"}":{"text\/html":{"en":{"P7482":"original creation by uploader<\/a>"}},"text\/plain":{"en":{"P7482":"original creation by uploader"}}}}" class="wbmi-entityview-statementsGroup wbmi-entityview-statementsGroup-P7482 oo-ui-layout oo-ui-panelLayout oo-ui-panelLayout-framed">
media type<\/a>"}},"text\/plain":{"en":{"":"media type"}}},"{\"value\":\"image\\\/svg+xml\",\"type\":\"string\"}":{"text\/html":{"en":{"P1163":"image\/svg+xml"}},"text\/plain":{"en":{"P1163":"image\/svg+xml"}}}}" class="wbmi-entityview-statementsGroup wbmi-entityview-statementsGroup-P1163 oo-ui-layout oo-ui-panelLayout oo-ui-panelLayout-framed">

image/svg+xml

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current20:18, 1 January 2014 Thumbnail for version as of 20:18, 1 January 2014 663 ×ばつ 500 (3.14 MB)IkamusumeFan User created page with UploadWizard

The following page uses this file:

Global file usage

The following other wikis use this file:

Metadata

This file contains additional information, probably added from the digital camera or scanner used to create or digitize it.

If the file has been modified from its original state, some details may not fully reflect the modified file.

Width662.5
Height500

AltStyle によって変換されたページ (->オリジナル) /