Constrained tuning: Difference between revisions

Mike Battaglia (talk | contribs)
formatting intro
Mike Battaglia (talk | contribs)
Line 189: Line 189:
== Simple Fast Algorithm ==
== Simple Fast Algorithm ==


A much simpler way to compute the CTE tuning is just to note that it's what we get if we modify the TE tuning so that the weighting of the 2's coefficient is very large. As the weighting goes to infinity, we get the CTE tuning. Thus, we can set it to some sufficiently large number, so that we get whatever numerical precision we want, and compute the result in closed-form using the pseudoinverse. The calculation is only about five lines of python code:
A much simpler way to compute the CTE tuning is just to note that it's what we get if we modify the TE tuning so that the weighting of the 2's coefficient is very large. As the weighting goes to infinity, we get the CTE tuning. Thus, we can set it to some sufficiently large number, so that we get whatever numerical precision we want, and compute the result in closed-form using the pseudoinverse. Without comments, docstrings, etc, the calculation is only about five lines of python code:


  import numpy as np
  import numpy as np