SAPC | R Documentation |
The stochastic approximate component method can handle online data sets.
SAPC(data, m, eta, alpha)
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 |
T2,T2k,V,Vhat,lambdahat,time
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.