function rvplot(X, pf, cf, n) % rvplot(X, pf, cf, n) plots information on the random variable X and % its associated probability and cumulative functions. % % n is a row vector containing the number of bars in each histogram, in % the following order: % all experiments histogram % minimums % maximums % ranges % means % standardized means % % if n is empty, a default value of 10 is used if ispf(pf)==0 error('invalid probability function') end if iscf(cf)==0 error('invalid cumulative functions') end if ~(n==[]) & ~(length(n)==6) error('invalid n vector') end if n==[] B=ones(1,6).*10; else B=n; end s=size(X); n=s(2); subplot(2,3,1) histo(X, pf, B(1)) title('All expirements histogram') subplot(2,3,2) histo(rvmin(X), ostat(pf, cf, n, 1), B(2)) title('Minimums') subplot(2,3,3) histo(rvmax(X), ostat(pf, cf, n, n), B(3)) title('Maximums') subplot(2,3,4) f=rvrange(X); [N, x]=hist(f, B(4)); N=N./length(f); if isdiscrt(pf)==0 N=(N.*B(4))./(max(f)-min(f)); end bar(x, N, 'r') title('Ranges') subplot(2,3,5) f=rvmean(X); [N, x]=hist(f, B(5)); N=N./length(f); if isdiscrt(pf)==0 & max(f)>0 N=(N.*B(5))./(max(f)-min(f)); end bar(x, N, 'r') title('Means') subplot(2,3,6) f=(f-mean(f))./std(f); [N, x]=hist(f, B(6)); N=N./length(f); if isdiscrt(pf)==0 N=(N.*B(6))./(max(f)-min(f)); N=N./sum(N); end bar(x, N, 'r') title('Standardized means')