| pdensity {exams.forge} | R Documentation |
Density Function
Description
Creates a linear (power=1) or constant (power=0) density function in a interval
[a, b]
where
a and b are sampled from x. It samples size elements without replacement and computes
the value of the distribution function.
Usage
pdensity(x, size = 3, power = 1, tol = 1e-06)
sample_density(x, size = 3, power = 1, tol = 1e-06)
Arguments
x |
numeric: range of density with |
size |
numeric: number of elements to be sampled (without replacement) from x |
power |
numeric: constant or linear density function |
tol |
numeric: disallow for density coefficients near zero (default: |
Value
A list with:
-
athe minimum of the interval -
ithe maximum of the interval -
xthesizesampled values -
fxthe distribution function atx -
pcoeffa polynomial (intercept = first value) -
qcoeffindefinite integral of the polynomial (intercept = first value) -
pintresult of theintegral(pcoeff, c(a,b), 0:2)
Examples
pdensity(-5:5)
pdensity(-5:5, power=1)