anchor.diff:  
   ##Smoothing spline
   
  -A smoothing spline aims to minimize a function with two error terms: 
  -- error1: sum of squared residuals
  +A smoothing spline aims to minimize a function consisting of two error terms: 
  +
  + - error1: sum of squared residuals
  +
       - Similar to the OrdinaryLeastSquares regression this error term ensures the fidelity to the data.
  -- error2: integral of the second derivative of the fitting function
  +
  + - error2: integral of the second derivative of the fitting function
  +
       - This error term ensures the smoothness of the resulting curve.
   
   A smoothing parameter (lambda) mediates between the two error terms.
  -- E = error1 + (lambda * error2)
  +
  + - E = error1 + (lambda * error2)
  +
       - If lambda = 0, the the resulting curve minimizes the sum of squared residuals and results in an interpolating curve.
  +
       - If lambda = infinity, the resulting curve is punished by the smoothness measurement and results in a straight regression line.
   
   The spline is constructed out of piecewise cubic polynomials that meet at knots. In the defined knots the function is continuous. 
  
positive.code: open FSharp.Plotly
  open FSharp.Stats.Fitting.LinearRegression
  
  let x_Data = vector [|1.;2.;3.;|]
  let y_Data = vector [|4.;7.;9.;|]
  
  //Least squares simple linear regression
  let coefficientsLinearLS = 
  
negative.code:     [|1. .. 0.1 .. 4.|]
      |> Array.map (fun x -> x,spline lambda x)
      |> Chart.Line
      |> Chart.withTraceName (sprintf "lambda: %.3f" lambda)
  
  let rawChartS = Chart.Point(data)
  
  let smoothingSplines =
      [
      rawChartS
      fit 0.001
      fit 0.02
      fit 1.
      ]
      |> Chart.Combine
  
  (*** include-value:smoothingSplines ***)