DALSM_additive {DALSM} | R Documentation |
Extraction of the estimated additive terms in a DALSM.object
Description
Extract the estimated additive terms with their standard errors from a DALSM.object
resulting from the fit of a DALSM
model.
In addition to the estimated functions in the location and dispersion submodels, their values on a regular grid covering the observed covariate values
are reported together with credible intervals. The mean effective coverage of these pointwise credible intervals
for the additive terms with respect to given (optional) reference functions (such as the ones for the 'true' additive terms used
to generate data in a simulation study) can also be computed.
Usage
DALSM_additive(obj.DALSM, ngrid=101,
true.loc=NULL, true.disp=NULL, ci.level=NULL,
verbose=FALSE)
Arguments
obj.DALSM |
|
ngrid |
(optional) grid size of covariate values where the additive terms are calculated (default: 101). |
true.loc |
(optional) list of functions containing the 'true' additive terms in the location sub-model. |
true.disp |
(optional) list of functions containing the 'true' additive terms in the dispersion sub-model. |
ci.level |
(optional) level of credible intervals. |
verbose |
logical indicating whether the computed corverages should be printed out (default: TRUE). |
Value
It returns an invisible list containing:
J1
:
number of additive terms in the location sub-model.labels.loc
:
labels of the additive terms in the location sub-model.f.loc.grid
:
list of lengthJ1
with, for each additive term, a list of length 3 with elements 'x': a vector ofngrid
values for the covariate ; 'y.mat': a matrix with 3 columns (est,low,up) giving the additive term and its pointwise credible region ; se: the standard error of the additive term on the x-grid.f.loc
:
a list of lengthJ1
with, for each additive term <x>, a list with f.loc$x: a function computing the additive term f.loc(x) for a given covariate value 'x' ; attributes(f.loc$x): support, label, range.se.loc
:
a list of lengthJ1
with, for each additive term <x>, a list with se.loc$x: a function computing the s.e. of f(x) for a given covariate value 'x' ; attributes(se.loc$x): support, label, range.coverage.loc
:
iftrue.loc
is provided: a vector of lengthJ1
giving the average effective coverage of pointwise credible intervals for each of the additive terms in the location sub-model.J2
:
number of additive terms in the dispersion sub-model.labels.disp
:
labels of the additive terms in the dispersion sub-model.f.disp.grid
:
list of lengthJ2
with, for each additive term, a list of length 3 with elements 'x': a vector ofngrid
values for the covariate ; 'y.mat': a matrix with 3 columns (est,low,up) giving the additive term and its pointwise credible region ; se: the standard error of the additive term on the x-grid.f.disp
:
a list of lengthJ2
with, for each additive term <x>, a list with f.disp$x: a function computing the additive term f.disp(x) for a given covariate value 'x' ; attributes(f.disp$x): support, label, range.se.disp
:
a list of lengthJ2
with, for each additive term <x>, a list with se.disp$x: a function computing the s.e. of f(x) for a given covariate value 'x' ; attributes(se.disp$x): support, label, range.coverage.disp
:
if <true.disp> is provided: a vector of lengthJ2
giving the average effective coverage of pointwise credible intervals for each of the additive terms in the dispersion sub-model.
Author(s)
Philippe Lambert p.lambert@uliege.be
References
Lambert, P. (2021). Fast Bayesian inference using Laplace approximations in nonparametric double additive location-scale models with right- and interval-censored data. Computational Statistics and Data Analysis, 161: 107250. <doi:10.1016/j.csda.2021.107250>
See Also
DALSM.object
, DALSM
, print.DALSM
, plot.DALSM
.
Examples
require(DALSM)
data(DALSM_IncomeData)
resp = DALSM_IncomeData[,1:2]
fit = DALSM(y=resp,
formula1 = ~twoincomes+s(age)+s(eduyrs),
formula2 = ~twoincomes+s(age)+s(eduyrs),
data = DALSM_IncomeData)
obj = DALSM_additive(fit)
str(obj)
## Visualize the estimated additive terms for Age
## ... in the location submodel
with(obj$f.loc.grid$age, matplot(x,y.mat,
xlab="Age",ylab="f.loc(Age)",
type="l",col=1,lty=c(1,2,2)))
## ... and in the dispersion submodel
with(obj$f.disp.grid$age, matplot(x,y.mat,
xlab="Age",ylab="f.disp(Age)",
type="l",col=1,lty=c(1,2,2)))
## Also report their values for selected age values
obj$f.loc$age(c(30,40,50)) ; obj$f.disp$age(c(30,40,50))
## ... together with their standard errors
obj$se.loc$age(c(30,40,50)) ; obj$se.disp$age(c(30,40,50))