Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

# Algebraic Manipulation of Random Variables (Numerical) 1.0

Date Added: August 26, 2013  |  Visits: 243

% [z zC Z ZC] = transRV(jointXY,C,opp,n) Numerically approximate the PDF of% a nonlinear combination of the random variables X and Y given the joint% distribution of X and Y. The joint distribution (jointXY) should be% generated using [jointXY, C] = hist3([x(:) y(:)]).%% z = transRV(jointXY,C,opp,n) Use the opperation opp which can% be: '+', '-', '*', or '/', to generate a PDF z of length n.%% z = transRV(...,'ZLim',[minz maxz]) specify the limits on z.%% z = transRV(...,'Visual') display the area of integration and CDF of Z.%% [z zC Z ZC zlim] = transRV(...) returns the PDF z with values centered at% zC, and the CDF Z with values centered at ZC. Also returns the limits on% z.%% NOTE: Results may be noisy if the output vector z has high resolution% (larger n) than the input distribution.%% EXAMPLE%% % Set the number of bins% n = 200;%% % Generate random variables% x = 2*randn(1000000,1);% y = .5*randn(1000000,1);%% % Display joint distribution% [jointXY C] = hist3([x y],[n n]);% figure; imagesc(C{1},C{2},jointXY');% set(gca,'YDir','normal')%% % Approximate new distribution% [z zC Z ZC zlim] = transRV(jointXY,C,'*',n,'ZLim',[-5,5],'Visual');%% % Compare to the distribution of data under the same opperation% zdata = x.*y;% [N xc] = hist(zdata(zdata >= zlim(1) & zdata

 Requirements: No special requirements Platforms: Matlab Keyword: Approximate,  Compare,  Display,  Figure,  Larger Users rating: 0/10