Description Usage Arguments Details Value Author(s) References See Also Examples
This function provides the Robust Regularized Singular Value Decomposition method based on Zhang, Shen and Huang (2013). We will return the first triplets: singular value, left and right singular vectors, for the first robust and regualrized SVD component.
1 2 3 4 |
data |
The input data. |
irobust |
A logical value. |
huberk |
The Huber robustness parameter. The default value is 1.345, as suggested in many Robust Statistics textbook |
iinituv |
A logical value. |
inits |
The initial value for |
initu |
The initial value for |
initv |
The initial value for |
niter |
The largest possible iteration number. The default value is set to be 1000. |
tol |
The tolerance for numberical zero. The default value is 1e-5 |
istablize |
A logical value. |
uspar |
A specified smoothing parameter for |
vspar |
A specified smoothing parameter for |
iugcv |
A logical value. |
ivgcv |
A logical value. |
usparmax |
When |
usparmin |
When |
nuspar |
When |
iloguspar |
A logical value. When |
vsparmax |
When |
vsparmin |
When |
nvspar |
When |
ilogvspar |
A logical value. When |
This program applied alternating regression technique to estimate singular value decomposition. The usual least squares for regular SVD is replaced by the iterative reweighted least squares to achieve robustness.
A list contains the following fields
s |
The singular value |
u |
The left singular vector, or singular column |
v |
The right singular vector, or singular row |
diagout |
A list of diagnosis measures, which include |
Lingsong Zhang (lingsong@purdue.edu) and Chao Pan (panc@purdue.edu)
Zhang, L., Shen, H., & Huang, J. Z. (2013). Robust regularized singular value decomposition with application to mortality data. The Annals of Applied Statistics, 7(3), 1540-1561.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | #generate a simulated data set, which is provided in Zhang et al (2013) AoAS paper.
u0<-log(10/9)*10^seq(0, 1, length=100)
v0<-sin(2*pi*seq(0, 1, length=100))/(1+1/pi)
s0<-773
data0<-s0*u0 %*% t(v0)
data<-data0+matrix(rnorm(10000, sd=20), nrow=100)
data[ceiling(10000*runif(50))]<-max(data0)+max(data0)*runif(50)
#the above provides random outlying cell simulation
#the svd calculation
data.svd<-RobRSVD(data, irobust=FALSE, uspar=0, vspar=0)
#the robsvd calculation
data.robsvd<-RobRSVD(data, irobust=TRUE, uspar=0, vspar=0)
#the ssvd calculation
data.ssvd<-RobRSVD(data, irobust=FALSE, iugcv=TRUE, ivgcv=TRUE)
#the robrsvd calculation
data.robrsvd<-RobRSVD(data, irobust=TRUE, iugcv=TRUE, ivgcv=TRUE)
#compare v's
plot(data.svd$v, type='l', ylab='V')
lines(data.robrsvd$v, col=2)
lines(data.ssvd$v, col=6)
lines(data.robsvd$v, col=4)
#compare u's
plot(data.svd$u, type='l', ylab='U')
lines(data.robrsvd$u, col=2)
lines(data.ssvd$u, col=6)
lines(data.robsvd$u, col=4)
#compare approximation matrices
#app.svd=data.svd$s * data.svd$u %*% t(data.svd$v)
#app.ssvd=data.ssvd$s * data.ssvd$u %*% t(data.ssvd$v)
#app.robsvd=data.robsvd$s * data.robsvd$u %*% t(data.robsvd$v)
#app.robrsvd=data.robrsvd$s * data.robrsvd$u %*% t(data.robrsvd$v)
#par(mfrow=c(2, 2))
#persp(app.svd, main='SVD', theta=-45, phi=40, xlab='', ylab='', zlab='')
#persp(app.ssvd, main='Regularized SVD', theta=-45, phi=40, xlab='', ylab='', zlab='');
#persp(app.robsvd, main='Robust SVD', theta=-45, phi=40, xlab='', ylab='', zlab='');
#persp(app.robrsvd, main='RobRSVD', theta=-45, phi=40, xlab='', ylab='', zlab='');
#dev.off()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.