%

clear all
close all

  disp('Mean and Variance in Normals are Independent')
  lw = 2; 
  set(0, 'DefaultAxesFontSize', 16);
  fs = 15;
  msize = 8;
%This code demonstrates empirically that in samples from the normal
%distribution the mean and variance are independent.
%A matrix of size 100x1000 of standard normals is generated.
%(100 columns, each of size 1000), and pairs (mean, variance) are
%found and ploted for each column. Coefficient of correlation
%between ccordinates in the pairs is close to 0.

randn('state',10)


x=normrnd(0, 1,[100, 1000]);
xx = mean(x); yy=var(x);
corr(xx', yy') %0.0294


plot(xx, yy, 'o', 'MarkerFaceColor','g',...
'MarkerEdgeColor','k','MarkerSize',msize)
xlabel('Means')
ylabel('Variances')


%print -depsc 'C:\BESTAT\Norm\Normeps\meanvarind.eps'


