tgpca: tgpca

Description Usage Arguments Value Examples

View source: R/mvTargetOpt.R

Description

Function which performs a principal component analysis (PCA) on the descriptor variable data (in the target space) given by dat, In order to choose a certain direction through the target point for the projections, wg has to be set to 1 – then the target point is chosen as center for the PCA. If wg lies between 0 and 1, pseudo observations at the target point are created such that a ratio of wg of the observations are pseudo observations. Then prcomp is applied to the standardized data and pseudo data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
tgpca(
  dat,
  tgmean = NULL,
  tgerr = NULL,
  wg = 1,
  wfun,
  mknormweights,
  yweights = F,
  ylast = NULL
)

Arguments

dat

matrix, data.frame

tgmean

numeric vector, optional

tgerr

numeric vector, optional

wg

numeric, weight for the target value. If wg equals 1 or 2 then the pca is performed with the target value as center

wfun

function, weight function

mknormweights

unused

yweights

boolean, use weights?

ylast

integer or NULL, if integer, ignore observations older than the last ylast evaluation points.

Value

returns the results of the pca and some extra stuff

Examples

1
tgpca(matrix(rnorm(20),ncol=2), tgmean=c(0,0))

amaendle/mvTargetOpt documentation built on June 12, 2020, 5:57 p.m.