degross_lpostBasic {degross}R Documentation

Log-posterior for given spline parameters, big bin (and optional: small bin) frequencies, tabulated sample moments and roughness penalty parameter. Compared to degross_lpost, no Fisher information matrix is computed and the gradient evaluation is optional, with a resulting computational gain.

Description

Log-posterior for given spline parameters, big bin (and optional: small bin) frequencies, tabulated sample moments and roughness penalty parameter. Compared to degross_lpost, no Fisher information matrix is computed and the gradient evaluation is optional, with a resulting computational gain.

Usage

degross_lpostBasic(phi, tau, n.i, degross.data,
                          use.moments = rep(TRUE,4), freq.min = 20, diag.only=FALSE,
                          gradient=FALSE,
                          penalize = TRUE, aa = 2, bb = 1e-6, pen.order = 3)

Arguments

phi

Vector of K B-spline parameters \phi to specify the log-density.

tau

Roughness penalty parameter.

n.i

Small bin frequencies.

degross.data

A degrossData.object created using the degrossData function.

use.moments

Vector with 4 logicals indicating which tabulated sample moments to use as soft constraints. Defaults: rep(TRUE,4).

freq.min

Minimal big bin frequency required to use the corresponding observed moments as soft constraints. Default: 20.

diag.only

Logical indicating whether to ignore the off-diagonal elements of the variance-covariance matrix of the sample central moments. Default: FALSE.

gradient

Logical indicating if the gradient (Score) of the \log p(\phi|\tau,data) should be computed (default: FALSE).

penalize

Logical indicating whether a roughness penalty of order pen.order is required (with tau \sim G(aa,bb)). Default: TRUE.

aa

Real giving the first parameter in the Gamma prior for tau. Default: 2.

bb

Real giving the second parameter in the Gamma prior for tau. Default: 1e-6.

pen.order

Integer giving the order of the roughness penalty. Default: 3.

Value

A list containing :

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_lpost, degross, degross.object.

Examples

sim = simDegrossData(n=3500, plotting=TRUE,choice=2) ## Generate grouped data
obj.data = degrossData(Big.bins=sim$Big.bins, freq.j=sim$freq.j, m.j=sim$m.j)
print(obj.data)
obj.fit = degross(obj.data) ## Estimate the underlying density
phi.hat = obj.fit$phi ; tau.hat = obj.fit$tau
## Evaluate the log-posterior at convergence
res = degross_lpostBasic(phi=phi.hat, tau=tau.hat, degross.data=obj.data,
                         gradient=TRUE)
print(res)


[Package degross version 0.9.0 Index]