部分的最小二乗回帰
p ( k ) ← X ( k ) T t ( k ) {\displaystyle p^{(k)}\gets {X^{(k)}}^{T}t^{(k)}}
q k ← y T t ( k ) {\displaystyle q_{k}\gets {y}^{T}t^{(k)}} (これはスカラー)
if q k = 0 {\displaystyle q_{k}=0}
l ← k {\displaystyle l\gets k} , ループから脱出
if k < l {\displaystyle k<l}
X ( k + 1 ) ← X ( k ) − t k t ( k ) p ( k ) T {\displaystyle X^{(k+1)}\gets X^{(k)}-t_{k}t^{(k)}{p^{(k)}}^{T}}
w ( k + 1 ) ← X ( k + 1 ) T y {\displaystyle w^{(k+1)}\gets {X^{(k+1)}}^{T}y}
t ( k + 1 ) ← X ( k + 1 ) w ( k + 1 ) {\displaystyle t^{(k+1)}\gets X^{(k+1)}w^{(k+1)}}
end for
define W to be the matrix with columns w ( 0 ) , w ( 1 ) , . . .