Description Usage Arguments Details Value Examples
This function computes a solution path of the Fantope Projection and
Selection (FPS) estimator. It takes a symmetric matrix S
as input
and returns an object containing a list of projection matrices
estimated by FPS over a sequence of regularization parameter values.
Fantope Project and Select
1 2 3 | fps(S, ndim, nsol = 50L, maxnvar = -1L, lambdamin = -1,
lambda = as.numeric(c()), maxiter = 100L, tolerance = 0.001,
verbose = 0L)
|
S |
Input matrix (assumed to be symmetric) |
ndim |
Target subspace dimension (can be fractional) |
nsol |
Number of solutions to compute |
maxnvar |
Suggested maximum number of variables to include
(ignored if |
lambdamin |
Minimum value of lambda (set automatically if
|
lambda |
Vector of regularization parameter values; overrides //' nsol, maxnvar, and lambdamin if nonempty |
maxiter |
Maximum number of iterations for each solution |
tolerance |
Convergence threshold |
verbose |
Level of verbosity; Silent if |
By default, a sensible minimum value of the regularization parameter is automatically chosen so that the minimally regularized solution is different from PCA.
For large input matrices (1000-by-1000 or larger) it is recommended
that the maxnvar
argument be set to a reasonably small number.
An S3 object of class fps
which is a list with the
following components:
ndim |
trace (dimension) of the estimate |
lambda |
a vector containing the regularization parameters of each estimate |
projection |
a list containing the the projection matrix estimates |
leverage |
a matrix whose columns are the diagonal entries of the projection matrix estimates |
L1 |
a vector of the sum of absolute values of each estimate |
var.explained |
variance explained by each estimate (trace inner
product of the projection and |
var.total |
total variance (trace of |
niter |
a vector containing the number of ADMM iterations for each estimate |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # Apply FPS to the standardized wine data from the UCI ML repository
data(wine)
out <- fps(cor(wine), ndim = 2)
print(out)
plot(out)
# Create a synthetic dataset by adding noise variables to the wine data
j <- sample(1:ncol(wine), size = 500 - ncol(wine), replace = TRUE)
noise <- apply(wine[, j], 2, sample, replace = TRUE)
colnames(noise) <- rep('noise', ncol(noise))
x <- cbind(wine, noise)
out <- fps(cor(x), ndim = 2, maxnvar = 50, verbose = 1)
## Not run:
# Choose lambda by cross-validation (this may take a few minutes)
cvout <- cv(out, x, FUN = cor, verbose = 1)
plot(cvout)
v <- coef(out, lambda = cvout$lambda.cv)
print(v)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.