Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What a weird way to write the harmonic average.

----

Write v_i = Var[X_i]. John writes

    t_i = \frac{\prod_{j\ne i} v_j}{\sum_{k=1}^n \prod_{j\ne k} v_j}.
But if you multiply top and bottom by (1 / \prod_{m=1}^n v_m), you just get

   t_i = \frac{1/v_i}{\sum_{k=1}^n 1/v_k}.
No need to compute elementary symmetric polynomials.

If you plug those optimal (t_i) back into the variance, you get

    \min Var[\sum t_i X_i] = 1/(\sum_{k=1}^n 1/v_k) = H/n,
where `H = n / (\sum_{k=1}^n 1/v_k)` is the Harmonic Mean of the variances.


It would be much more readable if AsciiMath[0] is used and still gives you the benefit to render it with MathJax if required.

[0] https://asciimath.org/


There are also ASCII-art ways of writing formulas. An LLM should be able to produce these.


Yeah and this is a much more intuitive way of generalising from the n = 2 case. Weights are proportional to inverse variance even for n > 2. Importantly this assumes independence so it doesn’t translate to portfolio optimisation very easily.


Right, this is known as the inverse variance weighting https://en.wikipedia.org/wiki/Inverse-variance_weighting.


Please will the mods implement maths rendering?? If the source were made available we could do it ourselves.


Once you implement that we’re stuck with it forever. One could just write sum(dy/dx) and be understood in context by one who is knowledgeable enough.


Being 'stuck' with maths rendering is like being 'stuck' with good health. Bring it on?


What else? Grammar checking? XML? Just approximate with ASCII, please.


Your slippery slope makes no sense to me. What do we need XML for here? Is anybody asking for it? You can use your own grammar checker but you can't render your own equations and submit them.


It’s a pretty raw website. You’re better served with an extension. A friend of mine made a Chrome extension we use for block / favorite lists e.g.


Even if you personally had a mathjax extension, you would still be prevented from explaining math to others, unless you could convince everyone to install it.


But you successfully did!


I hope this site does not.

ADDED. Because the new functionality will be used to create cutesy effects for reasons that have nothing to do with communicating math, increasing the demand for moderation work.


Why? Latex is not how maths if supposed to be read, else we'd all be doing that. It's how it might be written.

edit: Nobody is going to use maths for cutesy effects. Where have you ever seen that happen? Downvote them if they do. It is not going to be a big deal.


Get a grip


It’s much clearer when you write these problems in terms of matrix math. The minimum variance portfolio is very important in finance.


How would you write this with matrices? It seems like there are many ways you could generalize.


Let w be the vector of weights and S be the comformable matrix of covariances. The portfolio variance is given by w’Sw. So just minimize that with whatever constraints you want. If you just asssume weights sum to one, it is a classic quadratic optimization with linear equality constraints. Well known solutions.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: