lmarg.gammaTilde {ordgam} | R Documentation |
Marginal posterior density function for a remapped non-penalized parameter in an ordgam model
Description
Marginal posterior density function for a remapped non-penalized parameter in an ordgam model
Usage
lmarg.gammaTilde(gamtk, k, model)
Arguments
gamtk |
Remapped parameter value at which the marginal log posterior density for <gamma.tilde[k]> must be evaluated. |
k |
Targetted component in the vector of remapped non-penalized parameters <gamma.tilde>. |
model |
An |
Value
Log of p(gamma.tilde[k] | lambda,data)
Author(s)
Philippe Lambert p.lambert@uliege.be
References
Lambert, P. and Gressani, 0. (2023) Penalty parameter selection and asymmetry corrections to Laplace approximations in Bayesian P-splines models. Statistical Modelling. <doi:10.1177/1471082X231181173>. Preprint: <arXiv:2210.01668>.
See Also
Examples
library(ordgam)
data(freehmsData)
mod = ordgam(freehms ~ s(eduyrs) + s(age), data=freehmsData, descending=TRUE,
lambda0=c(192,18),select.lambda=FALSE)
ngamma = with(mod, nalpha+nfixed) ## Number of non-penalized parms
k = 1 ## Focus on gamma.tilde[1]
x.grid = seq(-4,4,length=7) ## Grid of values for gamma.tilde[k]
lfy.grid = ordgam::lmarg.gammaTilde(x.grid,k=k,mod) ## log p(gamma.tilde[k] | D) on the grid
gamt.ST = ordgam::STapprox(x.grid,lfy.grid)$dp ## Approximate using a skew-t
## Plot the estimated marginal posterior for <gamma.tilde[k]>
xlab = bquote(tilde(gamma)[.(k)])
ylab = bquote(p(tilde(gamma)[.(k)]~ "|"~lambda~","~D))
xlim = sn::qst(c(.0001,.9999),dp=gamt.ST)
curve(sn::dst(x,dp=gamt.ST),xlim=xlim,
xlab=xlab,ylab=ylab,col="blue",lwd=2,lty=1)
[Package ordgam version 0.9.1 Index]