tpcr: Targeted Principal Components Regression

Description Usage Arguments Details Value

View source: R/fit.R

Description

tpcr fits a principal components regression by maximizing a joint multivariate normal pseud-likelihood.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
tpcr(
  Y,
  X,
  k,
  rho = 0,
  tol = 1e-10,
  maxit = 1000,
  center_Y = TRUE,
  center_X = TRUE,
  scale_Y = FALSE,
  scale_X = FALSE,
  quiet = TRUE,
  L,
  m = 2,
  covmat = FALSE,
  Xnew = X
)

Arguments

Y

Matrix (n x r) of responses; rows correspond to observations

X

Matrix (n x p) of predictors; rows correspond to observations

k

Integer number of principal components to use; can be a vector

rho

Numeric ridge penalty on alpha in representation beta = L alpha

tol

Numeric tolerance for L-BFGS-B on profile log-likelihood

maxit

Integer maximum number of iterations of L-BFGS-B algorithm

center_Y

If TRUE, responses are centered by their sample average.

center_X

If TRUE, predictors are centered by their sample average.

scale_Y

If TRUE, responses are scaled to have unit sample standard deviation.

scale_X

If TRUE, predictors are scaled to have unit sample standard deviation.

quiet

If TRUE, suppresses information from optim (L-BFGS-B)

L

Matrix (p x k) starting value in L-BFGS-B for the Cholesky root in the decomposition Sigma_X = tau (I + LL')

m

Numeric penalty in information criterion - 2 * log-likelihood + m * n_params; can be a vector

covmat

If TRUE, calculates asymptotic covariance matrix of vec(beta)

Xnew

Matrix of new observations to predict the response for

Details

This is the only function exported from the package with the same name. The likelihood maximized is that for n independent observations from a normal multivariate response linear regression model where the column space of the p-by-r coefficient matrix is spanned by the k leading eigenvectors (corresponding to the largest eigenvalues) of the predictors' covariance matrix. This covariance matrix is assumed to be spiked, meaning its smallest eigenvalue has multiplicity p - k.

Value

If length(k) = 1, returns a list with estimates and information criterion. If scale_X or scale_Y are TRUE, estimates are rescaled to original scale.

If length(k) > 1, returns a list of lists of length k + 1 where for j in 1:k the jth element is the list returned by tpcr with k = k[j] and the (k + 1)th element is a vector of the same length as m where the jth element is the k selected by the IC corresponding to m[j].


koekvall/jlpcr documentation built on Jan. 6, 2022, 9:28 p.m.