OLS in Java

Least squares problems fall into two categories: linear or ordinary least squares and nonlinear least squares, depending on whether the residuals are linear in all unknowns. The linear least-squares problem occurs in statistical regression analysis; it has a closed-form solution. The nonlinear problem is usually solved by iterative refinement; at each iteration the system is approximated by a linear one, and thus the core calculation is similar in both cases.

One application of OLS is the volatility smile fitting.

Java Example.

Last updated

Was this helpful?