Learn R Programming

OPC (version 0.0.2)

SAPC: The stochastic approximate component method can handle online data sets.

Description

The stochastic approximate component method can handle online data sets.

Usage

SAPC(data, m, eta, alpha)

Value

T2,T2k,V,Vhat,lambdahat,time

Arguments

data

is a online data set

m

is the number of principal component

eta

is the proportion of online data to total data

alpha

is the step size

Examples

Run this code
library(MASS)
n=2000;p=20;m=9;
mu=t(matrix(rep(runif(p,0,1000),n),p,n))     
mu0=as.matrix(runif(m,0))
sigma0=diag(runif(m,1))
F=matrix(mvrnorm(n,mu0,sigma0),nrow=n)
A=matrix(runif(p*m,-1,1),nrow=p)
D=as.matrix(diag(rep(runif(p,0,1))))
epsilon=matrix(mvrnorm(n,rep(0,p),D),nrow=n)
data=mu+F%*%t(A)+epsilon
SAPC(data=data,m=m,eta=0.8,alpha=1) 

Run the code above in your browser using DataLab