fitted.carx: Fitted values of a 'carx' object

Description Usage Arguments Value Examples

View source: R/carx_fitted.R

Description

Compute the fitted values from a carx object. Note that the existence of censoring invalidates the usual Markov property for an AR model. Instead, the conditional distribution of Y^*_t given the past Ys and current and past covariates is the same as the conditional distribution D_t = D(Y^*_t|X_t, {(Y_{j}, X_j )}_{j=τ}^{t-1} ), where 1 ≤ τ ≤ t-p is the largest integer t such that none of Y_t;t=τ+p-1,...,τ is censored. In the case that τ = t-p, the fitted value can be readily computed; otherwise, the fitted value is computed as the mean of the distribution D_t by the function mtmvnorm from the package tmvtnorm.

Usage

1
2
## S3 method for class 'carx'
fitted(object, ...)

Arguments

object

a fitted carx object.

...

not used.

Value

the fitted values.

Examples

1
2
3
4
dat = carxSim(nObs=100,seed=0)
mdl <- carx(y~X1+X2-1,data=dat, p=2, CI.compute = FALSE)
#compute the fitted values
fv = fitted(mdl)

carx documentation built on May 2, 2019, 3:43 a.m.

Related to fitted.carx in carx...