<< distfun_gammainc Support distfun_getpath >>

distfun >> distfun > Support > distfun_genericpdf

distfun_genericpdf

Compute the PDF from the CDF.

Calling Sequence

distfun_genericpdf(x,cdffun)
distfun_genericpdf(x,cdffun,iscontinuous)

Parameters

x :

a matrix of doubles, the points where to evaluate the PDF.

cdffun :

a list, the CDF function and its arguments

iscontinuous :

a 1-by-1 matrix of booleans, %t for continuous variables, %f for integer variables (default iscontinuous=%t)

y :

a matrix of doubles, the density

Description

The distfun_genericpdf function computes the PDF from a given CDF, by derivation.

The CDF function should have header :

p=cdffun(x,a)
p=cdffun(x,a,b)
p=cdffun(x,a,b,c)

The cdffun function must be a list(f,a) or (f,a,b) or (f,a,b,c) where f is the PDF function and a, b, or c scalars which are automatically added at the end of the calling sequence.

The performance of this function may be poor.

Examples

x=3;
v1=5;
v2=6;
distfun_genericpdf(x,list(distfun_fcdf,v1,v2))
// Check with the exact PDF
distfun_fpdf(x,v1,v2)

// Integer distribution
x=3;
pr = 0.3;
computed = distfun_genericpdf(x,list(distfun_geocdf,pr),%f)
expected = distfun_geopdf(x,pr)

Authors


Report an issue
<< distfun_gammainc Support distfun_getpath >>