CXFTV2: a Fortran subroutine for the discrete least squares convex approximation. A Fortran subroutine calculates the least squares approximation to n data values containing random errors subject to nonnegative second divided differences (convexity). The method employs a dual active set quadratic programming technique that allows several concavities of an iterate to be corrected simultaneously, which is a distinctive feature of this calculation. A B-spline representation of the iterates reduces each active set calculation to an unconstrained minimization with fewer variables that requires only O(n) computer operations. Details of these techniques including the data structure that establishes the implementation of the method are specified. Numerical testing on a variety of data sets indicates that the subroutine is particularly efficient, terminating after a small number of active set changes, the subroutine being suitable for large numbers of data. A numerical example and its output is provided to help the use of the software. (Source: