ddegross: Density function based on an object resulting from the...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/ddegross.R

Description

Density function based on an object resulting from the estimation procedure in degross.

Usage

1
ddegross(x, degross.fit, phi)

Arguments

x

Scalar or vector where the fitted density must be evaluated.

degross.fit

A degross.object generated using degross and containing the density estimation results.

phi

(Optional) vector of spline parameters for the log density (default: degross.fit$phi if missing).

Value

A scalar or vector of the same length as x containing the value of the fitted density at x.

Author(s)

Philippe Lambert p.lambert@uliege.be

References

Lambert, P. (2021) Moment-based density and risk estimation from grouped summary statistics. arXiv:2107.03883.

See Also

degross.object, pdegross, qdegross, degross.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Generate grouped data
sim = simDegrossData(n=1500, plotting=TRUE, choice=2)

## Create a degrossData object
obj.data = degrossData(Big.bins=sim$Big.bins, freq.j=sim$freq.j, m.j=sim$m.j)
print(obj.data)

## Estimate the density
obj.fit = degross(obj.data)

## Superpose the fitted density using the <ddegross> function
curve(ddegross(x,obj.fit),add=TRUE,lty="dashed")
legend("topright",lty="dashed",lwd=2,legend="Estimated",box.lty=0, inset=.04)

degross documentation built on Aug. 4, 2021, 5:06 p.m.

Related to ddegross in degross...