package com.imsl.test.example.math; import com.imsl.math.*; /** *
* Fits a least squares B-spline to data. *
* * A B-Spline is fitted to data using the least squares criterion. The value of * the spline at point 4.5 is printed. * * @see Code * @see Output * */ public class BsLeastSquaresEx1 { public static void main(String args[]) { double x[] = {0, 1, 2, 3, 4, 5, 8, 9, 10}; double y[] = {1.0, 0.8, 2.4, 3.1, 4.5, 5.8, 6.2, 4.9, 3.7}; BsLeastSquares bs = new BsLeastSquares(x, y, 5); double bsv = bs.value(4.5); System.out.println("The computed B-spline value at point 4.5 is " + bsv); } }