Given a data vector y in &realn, minimize ||y &minus &phi||2 , over &phi1 &le &phi2 &le ... &le &phin
The following code has argument y, and returns the least-squares nondecreasing solution.
Given a scatterplot of data vector (x,y) where x,y in &realn, minimize ||y &minus &phi||2 , over A&phi&ge 0, where the non-zero elements of the (n-2) by n constraint matrix A are
Ai,i=xi+2 &minus xi+1; Ai,i+1=xi &minus xi+2; and Ai,i+2=xi+1 &minus xi, for i=1,...n-2.
The following code has arguments x and y and returns the solution.
Given a scatterplot of data vector (x,y) where x,y in &realn, minimize ||y &minus &phi||2 , over A&phi&ge 0, where the non-zero elements of the (n-1) by n constraint matrix A are
Ai,i=xi+2 &minus xi+1; Ai,i+1=xi &minus xi+2; Ai,i+2=xi+1 &minus xi for i=1,...n-2, and An-1,1=-1; An-1,2=1.
The following code has arguments x and y and returns the solution.
Given a scatterplot of data vector (x,y) where x,y in &realn, minimize ||y &minus &phi||2 , over A&phi&ge 0, where the non-zero elements of the (n-1) by n constraint matrix A are
Ai,i=xi+2 &minus xi+1; Ai,i+1=xi &minus xi+2; Ai,i+2=xi+1 &minus xi for i=1,...n-2, and An-1,n-1=1; An-1,n=-1.
The following code has arguments x and y and returns the solution.