Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

directions.cve

Computes projected training data X for given dimension 'k'.


Description

Returns B'X. That is, it computes the projection of the n x p design matrix X on the column space of B of dimension k.

Usage

## S3 method for class 'cve'
directions(object, k, ...)

Arguments

object

an object of class "cve", usually, a result of a call to cve or cve.call.

k

SDR dimension to use for projection.

...

ignored (no additional arguments).

Value

the n x k dimensional matrix X B where B is the cve-estimate for dimension k.

See Also

Examples

# create B for simulation (k = 1)
B <- rep(1, 5) / sqrt(5)
set.seed(21)
# creat predictor data x ~ N(0, I_p)
x <- matrix(rnorm(500), 100, 5)
# simulate response variable
#    y = f(B'x) + err
# with f(x1) = x1 and err ~ N(0, 0.25^2)
y <- x %*% B + 0.25 * rnorm(100)
# calculate cve with method 'mean' for k = 1
set.seed(21)
cve.obj.mean <- cve(y ~ x, k = 1, method = 'mean')
# get projected data for k = 1
x.proj <- directions(cve.obj.mean, k = 1)
# plot y against projected data
plot(x.proj, y)

CVarE

Conditional Variance Estimator for Sufficient Dimension Reduction

v1.1
GPL-3
Authors
Daniel Kapla [aut, cph, cre], Lukas Fertl [aut, cph], Efstathia Bura [ctb]
Initial release
2021-03-09

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.