% Plot QQPLOT
clear all
close all

  disp('Simulation QQ-Plot')
  lw = 2; 
  set(0, 'DefaultAxesFontSize', 16);
  fs = 15;
  msize = 10;


rand('twister',5489)
n=200;  
X = unifrnd(-10, 10, [1 n]);
c= 0.5; q=((1-c)/n):1/n:((n-2*c+1)/n); %c= 1/3 or c=0.3175
qY = norminv(q);
qX = sort(X);
figure(1)
plot(qX, qY, '*')
xlabel('Empirical Quantiles')
ylabel('Standard Normal Quantiles')
% print -depsc 'C:\Brani\Courses\bmestatu\BMESBOOK\Goodness\qqplot1.eps'
figure(2)
qY = unifinv(q);
plot(qX, qY, '*')
xlabel('Empirical Quantiles')
ylabel('Uniform (0,1) Quantiles')
% print -depsc 'C:\Brani\Courses\bmestatu\BMESBOOK\Goodness\qqplot2.eps'