Fitted values of a carx object

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)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.