Skip to content

Instantly share code, notes, and snippets.

@alphaville
Created October 18, 2013 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alphaville/7041800 to your computer and use it in GitHub Desktop.
Save alphaville/7041800 to your computer and use it in GitHub Desktop.
clear all;
% Provide some random data (here we sample from a normal
% distribution using the funtion `randn` of MATLAB):
random_data = 50+randn(100000,1);
% Define the number of bins that are necessary for the
% reconstruction of the PDF:
nBins_reconstruction = 50;
% Construct an instance of PDFsampler:
sampler=PDFsampler(random_data,nBins_reconstruction);
% Collect some samples using PDFsampler:
nSamples=5e4;
y=zeros(nSamples,1);
for i=1:nSamples
y(i,1)=sampler.nextRandom;
end
% QQ-plot:
qqplot(y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment