Home > wafo > wstats > mdist2dpdf2.m

# mdist2dpdf2

## PURPOSE

Joint 2D PDF due to Plackett given as f{x1}*f{x2}*G(x1,x2;Psi).

## SYNOPSIS

y = dist2dpdf2(v1,h1,phat)

## DESCRIPTION

```  MDIST2DPDF2 Joint 2D PDF due to Plackett given as  f{x1}*f{x2}*G(x1,x2;Psi).

CALL:  f = dist2dpdf2(x1,x2,phat);

f  = PDF struct with the following fields:
f = PDF evaluated at meshgrid(x1,x2)
x = {x1,x2} (i.e., cellarray containing x1 and x2)
x1,x2  = vectors of evaluation points
phat = structure array containing
x    = cellarray of distribution parameters
dist = cellarray of strings defining the marginal
distributions of X1 and X2, respectively. Options are:
'tgumbel', 'gumbel', 'lognormal','rayleigh','weibull',
and 'gamma'.

MDIST2DPDF2 evaluates f{x1}*f{x2}*psi(x1,x2).
The parameter(s) of the marginal distribution of X1 and X2,
must be in in phat.x{1} and phat.x{2}, respectively. phat.x{3}
gives the interaction parameter.

Example: 2D Rayleigh
x1 = linspace(0,10)';
phat.x={2 3  10 };
phat.dist={'rayl','rayl'};
f = mdist2dpdf2(x1,x1,phat);
pdfplot(f);

## CROSS-REFERENCE INFORMATION

This function calls:
 createpdf PDF class constructor mdist2dpdf Joint 2D PDF due to Plackett given as f{x1}*f{x2}*G(x1,x2;Psi). qlevels Calculates quantile levels which encloses P% of PDF error Display message and abort function. meshgrid X and Y arrays for 3-D plots.
This function is called by:

## SOURCE CODE

```001 function y = dist2dpdf2(v1,h1,phat)
002 % MDIST2DPDF2 Joint 2D PDF due to Plackett given as  f{x1}*f{x2}*G(x1,x2;Psi).
003 %
004 %  CALL:  f = dist2dpdf2(x1,x2,phat);
005 %
006 %      f  = PDF struct with the following fields:
007 %           f = PDF evaluated at meshgrid(x1,x2)
008 %        x = {x1,x2} (i.e., cellarray containing x1 and x2)
009 %  x1,x2  = vectors of evaluation points
010 %    phat = structure array containing
011 %           x    = cellarray of distribution parameters
012 %           dist = cellarray of strings defining the marginal
013 %                  distributions of X1 and X2, respectively. Options are:
014 %                  'tgumbel', 'gumbel', 'lognormal','rayleigh','weibull',
015 %                  and 'gamma'.
016 %
017 %  MDIST2DPDF2 evaluates f{x1}*f{x2}*psi(x1,x2).
018 %   The parameter(s) of the marginal distribution of X1 and X2,
019 %   must be in in phat.x{1} and phat.x{2}, respectively. phat.x{3}
020 %   gives the interaction parameter.
021 %
022 % Example: 2D Rayleigh
023 %    x1 = linspace(0,10)';
024 %    phat.x={2 3  10 };
025 %    phat.dist={'rayl','rayl'};
026 %    f = mdist2dpdf2(x1,x1,phat);
027 %    pdfplot(f);
028 %
030
031 %tested on: matlab 5.2
032 % history:
033 % revised pab 29.10.2000
034 % - updated to new wstats
035 %  Per A. Brodtkorb 28.10.98
036
037 error(nargchk(3,3,nargin))
038 y=createpdf(2);
039 [X1 X2]=meshgrid(v1,h1);
040 y.f=  mdist2dpdf(X1,X2,phat);
041 y.x{1}=v1(:);
042 y.x{2}=h1(:);
043 [y.cl y.pl]=qlevels(y.f);
044 y.phat=phat;
045
046
047
048```

Mathematical Statistics
Centre for Mathematical Sciences
Lund University with Lund Institute of Technology

Comments or corrections to the WAFO group

Generated on Thu 06-Oct-2005 02:21:16 for WAFO by m2html © 2003