please i'm trying solve 7x2 matrix problem in form below using r- software:
a=array(c(5.54,0.96,1.59,2.07,0.73,10.64,8.28,1.41,3.77,3.11,3.74,2.93,8.29,3.33), c(7,2)) # [,1] [,2] #[1,] 5.54 1.41 #[2,] 0.96 3.77 #[3,] 1.59 3.11 #[4,] 2.07 3.74 #[5,] 0.73 2.93 #[6,] 10.64 8.29 #[7,] 8.28 3.33 b=c(80814.25,34334.75,47921.75,59514.25,26981.25,63010.25,46646.25) b #[1] 80814.25 34334.75 47921.75 59514.25 26981.25 63010.25 46646.25 solve (a,b) error in solve.default(a, b) : 'a' (7 x 2) must square %*% solve (a,b) error in solve.default(a, b) : 'a' (7 x 2) must square
what think can solve problem. need solution 2 variables, x1 , x2, in 7x2 matrix stated above.
it seems you're using solve
when needs square input. in ?solve
discusses how can use qr.solve
non-square matrices.
qr.solve(a,b) [,1] [1,] 3741.208 [2,] 6552.174
you might want check correct purposes. there other ways solve these types of problems. might though.
Comments
Post a Comment