Linearly Constrained least square:

  • Minimize subject to , equality constraints
  • is a solution of CLS if and holds for any -vector that satisfies
    • how many row of is dimension of
  • Piecewise-polynomial fitting:
    • In the case of splitting the graph into 2 in -axis, the use to estimate points on the left graph and for the right
    • Piecewise-polynomial has the form:
    • To connect the graph, we need and as constraints
    • Then fitting is minizing with constraints
    • Prediction error on is
    • Sum square error is where are the rows of
  • Solving CLS problem:
    • The constrants are
    • Use Lagrange Multipliers
      1. where is the vector of Larange
      2. Optimal conditions are: and
    • which we knew
    • first equations have form:
    • Togethe with to get KKT conditions:
      • a square set of linear equations in variable
    • Assumming KKT matrix is invertible:
      • KKT matrix is invertible if and only if has linearly independent rows and has linearly independent columns
    • implies
    • Compute in flops, order is flops
    • Vertification of solution:
      • For every satisfies
      • expand last term, using :
      • so so is the solution

Least-norm Problem:

  • A simple case of CLS, to minimize
    • with
    • subject to
  • Solving Least norm problem:
    • matrix always have independent columns
    • Assume that has indepent rows
    • Optimal condition reduce to
    • then and
    • Plug int the first equation to get
    • so when has linearly independent rows:
      • is a right inverse of
      • so for any satisfies
      • ans we now know is the smallest solution of

Constrained least square applications:

Portfolio allocation:
  • Allocate investment in a vector of different assets,
    • is the fraction of portfolio allocated in asset
    • can be negative, meaning short position
    • one of is the liquid, so
    • means the portfolio is all cash
  • Leverage
    • means all long position
    • means atleast 1 short position
  • Return over a period
    • is the return of asset over the period, in fractional increase or decrease in value
    • full portfolio return is
    • for -period, with return ; then
  • Return matrix:
    • Hold portfolio with weights over periods
    • define (assets) return matrix, with is return of asset in period
      • 1 row is return vector of 1 period,
      • 1 column is the time series of 1 asset
    • if last asset is risk-free, the last column of is where is the risk-free per-period interest rate
  • Portfolio return and risk:
    • porfolio return vector (1 entry is return of 1 asset),
    • average return is and risk is
    • for small per-period returns, we have
      • so return approximates the avg per-period increase of portfolio value
  • Annualized return and risk:
    • Mean return and risk are often expressed in annualized form
    • If there are trading periods per year:
      • annualized return
      • annualized risk
  • Portfolio optimization:
    • minize the risk:
      • with constrains and , meaning mean of past return is
    • solution are Pareto Optimal
    • Convert to contrained least squares:
      • minize
      • subject to
    • is -vector of past asset returns
    • solution: