principal-components

Total Least squares regression without intercept, with R

别来无恙 提交于 2019-12-11 07:00:56
问题 I need to calculate the beta of a regression between two prices with: No intercept Using Total Least Squares estimate In R there is the function prcomp to perform it. After it, how can I extract the beta? the code is `library(quantmod) # how to get closes getCloses <- function(sym) { ohlc <- getSymbols(sym, from="2009-01-01", to="2011-01-01", auto.assign=FALSE, return.class="zoo") Cl(ohlc)} # how to import data (2 assets) closes <- merge(IWM=getCloses("IWM"), VXZ=getCloses("VXZ"), all=FALSE)

What does “argument to 'which' is not logical” mean in FactoMineR MCA?

倖福魔咒の 提交于 2019-12-01 03:48:08
I'm trying to run an MCA on a datatable using FactoMineR. It contains only 0/1 numerical columns, and its size is 200.000 * 20. require(FactoMineR) result <- MCA(data[, colnames, with=F], ncp = 3) I get the following error : Error in which(unlist(lapply(listModa, is.numeric))) : argument to 'which' is not logical I didn't really know what to do with this error. Then I tried to turn every column to character , and everything worked. I thought it could be useful to someone else, and that maybe someone would be able to explain the error to me ;) Cheers It's difficult to tell without further input

What does “argument to 'which' is not logical” mean in FactoMineR MCA?

余生长醉 提交于 2019-11-30 02:40:33
问题 I'm trying to run an MCA on a datatable using FactoMineR. It contains only 0/1 numerical columns, and its size is 200.000 * 20. require(FactoMineR) result <- MCA(data[, colnames, with=F], ncp = 3) I get the following error : Error in which(unlist(lapply(listModa, is.numeric))) : argument to 'which' is not logical I didn't really know what to do with this error. Then I tried to turn every column to character , and everything worked. I thought it could be useful to someone else, and that maybe