Applications

Linear regression, portfolio optimization, and optimal transport

Applications of Optimization

Optimization runs quietly behind everyday tools. Here it fits a line to data, balances an investment portfolio, and finds the cheapest way to move a pile of mass.

Linear Regression

Press Start GD and watch the line settle onto the data while the path on the loss surface slides into the bottom of the bowl.

The MSE loss surface is convex (paraboloid), so gradient descent always finds the global minimum.
Go deeper:Linear Regression

Optimization is everywhere: machine learning minimizes loss functions, finance maximizes risk-adjusted returns, and logistics minimizes transportation costs. These applications demonstrate optimization in action.

Linear regression fits a line to data by minimizing the mean squared error. The loss surface is a convex paraboloid, guaranteeing gradient descent finds the global minimum. Watch the fit improve as GD converges.

Key insight: Linear regression is the simplest case of convex optimization in ML. The normal equations give the closed-form solution, but GD scales to millions of data points.

Portfolio Optimization

Slide the risk tolerance along the efficient frontier and watch the portfolio weights shift. Look for the Min Variance and Max Sharpe points.

5%10%15%20%25%4%6%8%10%12%14%Risk (Std Dev)Expected ReturnBondsLarge CapSmall CapIntl EquityCommoditiesMin VarianceMax SharpePortfolio Optimization — Efficient FrontierReturn: 7.3% Risk: 8.5%Portfolio WeightsBonds50%Large Cap20%Small Cap20%Intl Equity0%Commodities10%
50%

The efficient frontier shows the best achievable risk-return tradeoff. Move the slider to explore portfolios from minimum variance to maximum return.

Go deeper:Portfolio Optimization

Markowitz mean-variance optimization finds portfolios that maximize expected return for a given level of risk. The efficient frontier traces the best possible risk-return tradeoffs.

Key insight: Diversification is not just intuition — it is an optimization result. The minimum variance portfolio typically assigns non-zero weight to many assets, reducing risk below any individual asset.

Optimal Transport

Switch between the Nearest, Spread, and Optimal plans and compare their total costs. The optimal plan moves the mass the shortest total distance.

Compare transport plans: Nearest greedily matches nearby bins, Spread distributes evenly, and Optimal minimizes total distance times mass moved.

Go deeper:Optimal Transport

Optimal transport asks: what is the cheapest way to move mass from one distribution to another? The cost is the total distance times mass moved. The optimal plan minimizes this cost, giving the Earth Mover's Distance between distributions.

Key insight: Optimal transport connects to LP duality (Kantorovich formulation), geometry (Wasserstein metric), and machine learning (Wasserstein GANs). It is one of the most active areas of modern applied mathematics.

Key Takeaways

  • Linear regression is convex optimization: GD always finds the global MSE minimum.
  • Portfolio optimization traces the efficient frontier of risk-return tradeoffs.
  • Optimal transport minimizes the cost of moving mass between distributions.

Spot a mistake or have an idea?

Search