Open
Description
I'm getting a type error when trying to use pcgsolve_sparseOMP
. Here's an example:
> library(Matrix)
> library(cPCG)
> library(dplyr)
>
> aa <- data.frame(id = c(rep(1, 3), rep(2, 3)),
+ grp = c(3,4,4,3,3,4))
> aa$w = aa$id + (aa$grp-2) + rnorm(6)
>
> lm(w ~ as.factor(id) + as.factor(grp) - 1, aa) %>% coef %>% unname
[1] 2.0701328 3.2438530 0.1713803
>
> X <- model.matrix(w ~ as.factor(id) + as.factor(grp) - 1, aa)
> xx <- t(X) %*% X
> xy <- t(X) %*% aa$w
> pcgsolve(xx, xy) %>% t
[,1] [,2] [,3]
[1,] 2.070133 3.243853 0.1713803
>
> Sxx <- as(xx, "dgCMatrix")
> Sxy <- as(xy, "dgCMatrix")
>
> pcgsolve_sparseOMP(Sxx, Sxy)
Error in pcgsolve_sparseOMP(Sxx, Sxy) :
Not compatible with requested type: [type=S4; target=double].
Metadata
Metadata
Assignees
Labels
No labels