hello.
I have a query about the Matrix package for R. I wrote some code a while
ago using Matrix version 1.6.2 with an early version of R, to do some least
squares for regression:
xn
[,1] [,2] [,3] [,4]
[1,] 1 0.7429352 0.5519528 0.4100652
[2,] 1 0.7443713 0.5540886 0.4124477
[3,] 1 0.7447385 0.5546355 0.4130584
[4,] 1 0.7459597 0.5564558 0.4150936>
> temp<-crossprod(xn)
> temp
[,1] [,2] [,3] [,4]
[1,] 4.000000 2.978005 2.2171327 1.6506648
[2,] 2.978005 2.217133 1.6506648 1.2289297
[3,] 2.217133 1.650665 1.2289297 0.9149473
[4,] 1.650665 1.228930 0.9149473 0.6811865>
> solve.Matrix(temp,t(xn))
[,1] [,2] [,3] [,4]
[1,] 33397.34 122081.7 -241005.4 85527.48
[2,] 21063.72 -664920.2 812316.0 -168459.99
[3,] -236935.74 1125548.2 -877776.2 -10835.64
[4,] 199314.69 -608045.8 297509.1 111221.72
(Note: here I used solve.Matrix since the generic solve said the matrix is
singular).
I recently updated my versions of R to 1.9.1 and also Matrix package, but I
can't seem to get any similar equivalent to work (I get error messages like
".Call function name not in DLL for package Matrix" or "Lapack
routine
dpotrf returned error code 4"). Can anyone help me out?
many thanks
Matt Nunes