Matlab inverse of large matrix -
this equation trying solve:
h = (x'*x)^-1*x'*y
where x matrix , y vector ((x'x)^-1 inverse of x-transpose times x). have coded in matlab as:
h = (x'*x)\x'*y
which believe correct. problem x around 10000x10000, , trying calculate inverse crashing matlab on powerful computer can find (16 cores, 24gb ram). there way split up, or library designed doing such large inversions?
thank you.
i generated random 10,000 10,000 matrix x , random 10,000 1 vector y.
i broke computation step step. (code shown below)
- computed transpose , held in matrix k
- then computed matrix multiplying k x
- computed vector b multiplying k vector y
- lastly, used backslash operator on , b solve
i didn't have problem computation. took while, breaking operations smallest groups possible helped prevent computer being overwhelmed. however, composition of matrix using (ie. sparse, decimals, etc.).
x = randi(2000, [10000, 10000]); y = randi(2000, 10000, 1); k = x'; = k*x; b = k*y; s = a\b;
Comments
Post a Comment