Created
October 18, 2013 13:48
-
-
Save alphaville/7041800 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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