r语言 rchart包里的zoomtype什么意思
发布网友
发布时间:2022-08-11 06:34
我来回答
共1个回答
热心网友
时间:2024-07-27 16:26
先是对X和Z做处理:
xmean <- apply(X,2,mean); zmean <- apply(Z,2,mean)
xsd <- apply(X,2,sd); zsd <- apply(Z,2,sd)
xsd[xsd==0] <- 1; zsd[zsd==0] <- 1
Xs <- X - matrix(xmean, nrow(X), ncol(X), byrow=T)
Zs <- Z - matrix(zmean, nrow(Z), ncol(Z), byrow=T)
Xs <- Xs * matrix(1/xsd, nrow(X), ncol(X), byrow=T)
Zs <- Zs * matrix(1/zsd, nrow(Z), ncol(Z), byrow=T)
然后调用PMA包中的CCA函数:
res <- CCA(x=Xs,z=Zs,typex="standard", typez="standard", penaltyx=0.04, penaltyz=0.04, niter=15, K=80, trace=T, standardize=F)
程序就会提示出错:Error in CheckVs(v, x, z, K) : Problem computing SVD.