DIST2DPRB returns the probability for rectangular regions. CALL: [P tol] = dist2dprb(phat,x1lo,x1up,x2lo,x2up); P = probability tol = absolute tolerance, i.e., abs(int-intold) phat = parameter structure (see dist2dfit) xilo = lower integration limits xiup = upper integration limits The size of P is the common size of XILO and XIUP. Example x1=linspace(0,10)'; phat.x={[x1,exp(-0.1*x1)] 2 }; phat.dist={'rayl','rayl'}; dist2dprb(phat,1,2,1,2) f = dist2dpdf2(x1,x1,phat); pdfplot(f); hold on, plot([ 1 1 2 2 1],[1 2 2 1 1]), hold off See also dist2dfit dist2drnd dist2dpdf dist2dcdf
Numerically evaluates a 2D integral using Gauss quadrature. | |
Display message and abort function. |
001 function [y ,eps1] = dist2dprb(phat,x1lo,x1up,x2lo,x2up) 002 %DIST2DPRB returns the probability for rectangular regions. 003 % 004 % CALL: [P tol] = dist2dprb(phat,x1lo,x1up,x2lo,x2up); 005 % 006 % P = probability 007 % tol = absolute tolerance, i.e., abs(int-intold) 008 % phat = parameter structure (see dist2dfit) 009 % xilo = lower integration limits 010 % xiup = upper integration limits 011 % 012 % The size of P is the common size of XILO and XIUP. 013 % 014 % Example 015 % x1=linspace(0,10)'; 016 % phat.x={[x1,exp(-0.1*x1)] 2 }; 017 % phat.dist={'rayl','rayl'}; 018 % dist2dprb(phat,1,2,1,2) 019 % f = dist2dpdf2(x1,x1,phat); 020 % pdfplot(f); hold on, 021 % plot([ 1 1 2 2 1],[1 2 2 1 1]), hold off 022 % 023 % See also dist2dfit dist2drnd dist2dpdf dist2dcdf 024 025 026 % tested on: matlab 5.2 027 % history: 028 % revised pab 27.10.2000 029 % - added example text 030 % Per A. Brodtkorb 28.10.98 031 032 error(nargchk(5,5,nargin)) 033 %defining global variables 034 global PHAT CONDON 035 condon=CONDON; % save old value 036 CONDON=1; 037 if (nargin < 5), 038 error('Requires 5 input arguments.'); 039 end 040 eps2=1e-5;%relative tolerance 041 % nit toolbox function 042 [y eps1] = gaussq2d('dist2dfun',x1lo,x1up,x2lo,x2up,eps2); 043 CONDON=condon; %restore the default value 044 045 046
Comments or corrections to the WAFO group