In mathematics, particularly linear algebra and numerical analysis, the Gram–Schmidt process is a method for orthonormalizing a set of vectors in an inner product space, most commonly the Euclidean space Rn equipped with the standard inner product. The Gram–Schmidt process takes a finite, linearly independent set of vectors S = {v1, ..., vk} for k ≤ n and generates an orthogonal set S′ = {u1, ..., uk} that spans the same k-dimensional subspace of Rn as S.
The method is named after Jørgen Pedersen Gram and Erhard Schmidt, but Pierre-Simon Laplace had been familiar with it before Gram and Schmidt.
The application of the Gram–Schmidt process to the column vectors of a full column rank matrix yields the QR decomposition (it is decomposed into an orthogonal and a triangular matrix).
Here the provided code GSO.R gives a function called GSO()
which takes 2 arguements, one matrix - X
and one optional arguement tolerence - tol
, and returns an orthogonal matrix whose column vectors form an orthonormal basis (ONB) of column space of input matrix.
The tolerance is a level (with default value 10-8) depending on which the code decides whether a vector is null vector or not.
This GSO process works on Rn for any finite natural number n but visualisation of this process can be done only till R3(i.e. 3D). So here is a visualisation for n = 3 in gif format.