Jump to content

QR decomposition: Difference between revisions

m
Minor update
m (Minor update)
Line 2,807:
end
end</lang>
We can then show the examples:<lang sml>structure RealFieldRealRadicalCategoryField : RADCATFIELD = struct
open Real
val one = 1.0
Line 2,815:
end
val mat = Array2.fromList [[12.0, ~51.0, 4.0], [6.0, 167.0, ~68.0], [~4.0, 24.0, ~41.0]];
structure Q = QR(RealFieldRealRadicalCategoryField);
structure M = Q.M;
let val {q,r} = Q.qr(mat) in (M.print q; M.print r) end;
Line 2,826:
end
 
(* output *)
Array2.fromList([[~0.857142857143,0.394285714286,0.331428571429],
[~0.428571428571,~0.902857142857,~0.0342857142857],
Line 2,833 ⟶ 2,834:
[4.47505280695E~16,0.0,~35.0]])
val fit = [|1.0,2.0,3.0|] : real array</lang>
 
=={{header|Stata}}==
See [http://www.stata.com/help.cgi?mf_qrd QR decomposition] in Stata help.
136

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.