cve.call {CVE}R Documentation

Conditional Variance Estimator (CVE).

Description

This is the main function in the CVE package. It creates objects of class "cve" to estimate the mean subspace. Helper functions that require a "cve" object can then be applied to the output from this function.

Usage

cve.call(X, Y, method = "simple", nObs = sqrt(nrow(X)), h = NULL,
  min.dim = 1L, max.dim = 10L, k = NULL, momentum = 0, tau = 1,
  tol = 0.001, slack = 0, gamma = 0.5, V.init = NULL,
  max.iter = 50L, attempts = 10L, logger = NULL)

Arguments

X

Design predictor matrix.

Y

n-dimensional vector of responces.

method

specifies the CVE method variation as one of

  • "simple" exact implementation as described in the paper listed below.

  • "weighted" variation with addaptive weighting of slices.

nObs

parameter for choosing bandwidth h using estimate.bandwidth (ignored if h is supplied).

h

bandwidth or function to estimate bandwidth, defaults to internaly estimated bandwidth.

min.dim

lower bounds for k, (ignored if k is supplied).

max.dim

upper bounds for k, (ignored if k is supplied).

k

Dimension of lower dimensional projection, if k is given only the specified dimension B matrix is estimated.

momentum

number of [0, 1) giving the ration of momentum for eucledian gradient update with a momentum term. momentum = 0 corresponds to normal gradient descend.

tau

Initial step-size.

tol

Tolerance for break condition.

slack

Positive scaling to allow small increases of the loss while optimizing, i.e. slack = 0.1 allows the target function to increase up to 10 \% in one optimization step.

gamma

step-size reduction multiple. If gradient step with step size tau is not accepted gamma * tau is set to the next step size.

V.init

Semi-orthogonal matrix of dimensions '(ncol(X), ncol(X) - k) used as starting value in the optimization. (If supplied, attempts is set to 0 and k to match dimension).

max.iter

maximum number of optimization steps.

attempts

If V.init not supplied, the optimization is carried out attempts times with starting values drawn from the invariant measure on the Stiefel manifold (see rStiefel).

logger

a logger function (only for advanced users, slows down the computation).

Value

an S3 object of class cve with components:

X

design matrix of predictor vector used for calculating cve-estimate,

Y

n-dimensional vector of responses used for calculating cve-estimate,

method

Name of used method,

call

the matched call,

res

list of components V, L, B, loss, h for each k = min.dim, ..., max.dim. If k was supplied in the call min.dim = max.dim = k.

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 'simple' for k = 1
set.seed(21)
cve.obj.simple1 <- cve(Y ~ X, k = 1)

# same as
set.seed(21)
cve.obj.simple2 <- cve.call(X, Y, k = 1)

# extract estimated B's.
coef(cve.obj.simple1, k = 1)
coef(cve.obj.simple2, k = 1)

[Package CVE version 0.2 Index]