frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Start all of your commands with a comma (2009)

https://rhodesmill.org/brandon/2009/commands-with-comma/
233•theblazehen•2d ago•68 comments

OpenCiv3: Open-source, cross-platform reimagining of Civilization III

https://openciv3.org/
695•klaussilveira•15h ago•206 comments

Hoot: Scheme on WebAssembly

https://www.spritely.institute/hoot/
7•AlexeyBrin•1h ago•0 comments

The Waymo World Model

https://waymo.com/blog/2026/02/the-waymo-world-model-a-new-frontier-for-autonomous-driving-simula...
962•xnx•20h ago•555 comments

How we made geo joins 400× faster with H3 indexes

https://floedb.ai/blog/how-we-made-geo-joins-400-faster-with-h3-indexes
130•matheusalmeida•2d ago•35 comments

Unseen Footage of Atari Battlezone Arcade Cabinet Production

https://arcadeblogger.com/2026/02/02/unseen-footage-of-atari-battlezone-cabinet-production/
67•videotopia•4d ago•6 comments

Vocal Guide – belt sing without killing yourself

https://jesperordrup.github.io/vocal-guide/
54•jesperordrup•5h ago•25 comments

ga68, the GNU Algol 68 Compiler – FOSDEM 2026 [video]

https://fosdem.org/2026/schedule/event/PEXRTN-ga68-intro/
11•matt_d•3d ago•2 comments

Jeffrey Snover: "Welcome to the Room"

https://www.jsnover.com/blog/2026/02/01/welcome-to-the-room/
37•kaonwarb•3d ago•27 comments

Show HN: Look Ma, No Linux: Shell, App Installer, Vi, Cc on ESP32-S3 / BreezyBox

https://github.com/valdanylchuk/breezydemo
236•isitcontent•15h ago•26 comments

Monty: A minimal, secure Python interpreter written in Rust for use by AI

https://github.com/pydantic/monty
234•dmpetrov•16h ago•125 comments

Where did all the starships go?

https://www.datawrapper.de/blog/science-fiction-decline
33•speckx•3d ago•21 comments

UK infants ill after drinking contaminated baby formula of Nestle and Danone

https://www.bbc.com/news/articles/c931rxnwn3lo
12•__natty__•3h ago•0 comments

Show HN: I spent 4 years building a UI design tool with only the features I use

https://vecti.com
335•vecti•17h ago•147 comments

Hackers (1995) Animated Experience

https://hackers-1995.vercel.app/
502•todsacerdoti•23h ago•244 comments

Sheldon Brown's Bicycle Technical Info

https://www.sheldonbrown.com/
386•ostacke•21h ago•97 comments

Show HN: If you lose your memory, how to regain access to your computer?

https://eljojo.github.io/rememory/
300•eljojo•18h ago•186 comments

Microsoft open-sources LiteBox, a security-focused library OS

https://github.com/microsoft/litebox
361•aktau•22h ago•185 comments

An Update on Heroku

https://www.heroku.com/blog/an-update-on-heroku/
425•lstoll•21h ago•282 comments

PC Floppy Copy Protection: Vault Prolok

https://martypc.blogspot.com/2024/09/pc-floppy-copy-protection-vault-prolok.html
68•kmm•5d ago•10 comments

Dark Alley Mathematics

https://blog.szczepan.org/blog/three-points/
96•quibono•4d ago•22 comments

Was Benoit Mandelbrot a hedgehog or a fox?

https://arxiv.org/abs/2602.01122
21•bikenaga•3d ago•11 comments

The AI boom is causing shortages everywhere else

https://www.washingtonpost.com/technology/2026/02/07/ai-spending-economy-shortages/
19•1vuio0pswjnm7•1h ago•5 comments

How to effectively write quality code with AI

https://heidenstedt.org/posts/2026/how-to-effectively-write-quality-code-with-ai/
265•i5heu•18h ago•217 comments

Delimited Continuations vs. Lwt for Threads

https://mirageos.org/blog/delimcc-vs-lwt
33•romes•4d ago•3 comments

Introducing the Developer Knowledge API and MCP Server

https://developers.googleblog.com/introducing-the-developer-knowledge-api-and-mcp-server/
64•gfortaine•13h ago•28 comments

I now assume that all ads on Apple news are scams

https://kirkville.com/i-now-assume-that-all-ads-on-apple-news-are-scams/
1077•cdrnsf•1d ago•460 comments

Female Asian Elephant Calf Born at the Smithsonian National Zoo

https://www.si.edu/newsdesk/releases/female-asian-elephant-calf-born-smithsonians-national-zoo-an...
39•gmays•10h ago•13 comments

Understanding Neural Network, Visually

https://visualrambling.space/neural-network/
298•surprisetalk•3d ago•44 comments

I spent 5 years in DevOps – Solutions engineering gave me what I was missing

https://infisical.com/blog/devops-to-solutions-engineering
154•vmatsiiako•20h ago•72 comments
Open in hackernews

Weighting an average to minimize variance

https://www.johndcook.com/blog/2025/11/12/minimum-variance/
104•ibobev•2mo ago

Comments

whatever1•2mo ago
This is just the observed variance. Which means that you assume that this will be the variance in the future.

Don’t make decisions for evolving systems based on statistics.

Insider info on the other hand works much better.

JohnCClarke•2mo ago
Upvoting b/c this comment is true, obviously I disapprove of insider trading.
energy123•2mo ago
This is why Markowitz isn't used much in the industry, at least not in a plug-and-play fashion. Empirical volatility, and the variance -covariance matrix more generally speaking, is a useful descriptive statistic, but the matrix has high sampling variance, which means Markowitz is garbage in garbage out. Unlike in other fields, you can't just make/collect more data to reduce the sampling variance of the inputs. So you want to regularize the inputs or have some kind of hybrid approach that has a discretionary overlay.
pinkmuffinere•2mo ago
I have some familiarity with the Markowitz model, but certainly not as much as you do about the practical use — could you share notes/articles/talks on the practical use? I’m super interested to learn more.
energy123•2mo ago
Black-Litterman model is an example of how to address the shortcoming of unreliable empirical inputs.

You'll also see more ad hoc approaches, such as simulating hypothetical scenarios to determine worst case scenarios.

It's not math heavy. Math heavy is a smell. Expect to see fairly simple monte carlo simulations, but with significant thought put into the assumptions.

pinkmuffinere•2mo ago
Oooooh this is cool, thanks!
mhh__•2mo ago
Read "Advanced portfolio management" by Paleologo (ironically it's actually the introductory one of his two books), or "Active portfolio management" for a more thorough, older, longer book on the topic.

Markowitz isn't really used at all, but Markowitz-like reasoning is used extremely heavily in finance, by which I basically mean factor modelling of various kinds - effectively the result of taking mean-variance as a concept and using some fairly aggressive dimensionality reduction to cope with the problems of financial data, and the fact that one has proprietary views about things ("alpha" and so on)

pinkmuffinere•2mo ago
Thanks, just bought the book! Some nice reading for the holidays!
kgwgk•2mo ago
> This is why Markowitz isn't used much in the industry

This may be one reason but the return part is much more problematic than the risk part.

energy123•2mo ago
Very true, although the off-diagonal terms in the variance-covariance matrix are also hard to estimate, which is a problem, especially when simulating worst case scenarios, which is often when correlations tend to break down.
ijidak•2mo ago
Doesn't it make more sense to measure and minimize the variance of the underlying cash flows of the companies one is investing in, rather than the prices?

Price variance is a noisy statistic not based on any underlying data about a company, especially if we believe that stock prices are truly random.

mhh__•2mo ago
Volatility is fairly predictable. Or at least much more predictable than returns
CGMthrowaway•2mo ago
That's the first thing I thought of. I read the opening of this article and thought "oh this could be applied to a load balancing problem" but it immediately becomes obvious that you can't assume the variance is going to be uniform over time
paulgerhardt•2mo ago
I wish there was a Strunk and White for mathematics.

While by no means logically incorrect, it feels inelegant to setup a problem using variables A and B in the first paragraph and solve for X and Y in the second (compounded with the implicit X==B, and Y==A).

thomasahle•2mo ago
There are lots of good books on writing mathematics:

1. How to Write Mathematics — Paul Halmos

2. Mathematical Writing — Donald Knuth, Tracy Larrabee, and Paul Roberts

3. Handbook of Writing for the Mathematical Sciences — Nicholas J. Higham

4. Writing Mathematics Well — Steven Gill Williamson

paulgerhardt•2mo ago
Thanks. Higham explicitly addresses the authors substitution crime in section 2.5. Wonderful resource.

My complaint stems more to the general observation that readability is prized in math and programming but not emphasized in traditional education curriculum to the degree it is in writing.

Bad style is seldomly commented on in our profession.

thomasahle•2mo ago
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.
1980phipsi•2mo ago
It’s much clearer when you write these problems in terms of matrix math. The minimum variance portfolio is very important in finance.
thomasahle•2mo ago
How would you write this with matrices? It seems like there are many ways you could generalize.
1980phipsi•2mo ago
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.
esafak•2mo ago
Please will the mods implement maths rendering?? If the source were made available we could do it ourselves.
hyperhello•2mo ago
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.
esafak•2mo ago
Being 'stuck' with maths rendering is like being 'stuck' with good health. Bring it on?
hyperhello•2mo ago
What else? Grammar checking? XML? Just approximate with ASCII, please.
esafak•2mo ago
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.
hollerith•2mo ago
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.

esafak•2mo ago
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.

huflungdung•2mo ago
[flagged]
renewiltord•2mo ago
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.
thomasahle•2mo ago
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.
renewiltord•2mo ago
But you successfully did!
smartmic•2mo ago
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/

ogogmad•2mo ago
There are also ASCII-art ways of writing formulas. An LLM should be able to produce these.
conformist•2mo ago
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.
rhymer•2mo ago
Right, this is known as the inverse variance weighting https://en.wikipedia.org/wiki/Inverse-variance_weighting.
abcd_f•2mo ago
If A and B have different volatilities, it's rather counter-intuitive to allocate proportionally rather than just all to the one with the lower volatility... :-/
WCSTombs•2mo ago
I agree, and I had to think about it for a second, but now it seems obvious. It works for the exact same reason that averaging multiple independent measurements can give a more accurate result. The key fact is that the different random variables are all independent, so it's unlikely that the various deviations from the means will line up in the same direction.
maest•2mo ago
The independence assumption means there's value in allocating to the more volatile one, due to diversification.
bo1024•2mo ago
Yes, I think that's part of the point of the post. One intuition is that allocating only a little bit to a highly volatile asset creates a not-very volatile asset. Investing a little bit is the same as scaling the asset down until it's not very volatile.
10000truths•2mo ago
I realize that this is meant as an exercise to demonstrate a property of variance. But most investors are risk-averse when it comes to their portfolio - for the example given, a more practical target to optimize would be worst-case or near-worst-case return (e.g. p99). For calculating that, a summary measure like variance or mean does not suffice - you need the full distribution of the RoR of assets A and B, and find the value of t that optimizes the p99 of At+B(1-t).
energy123•2mo ago
It's hard enough to get a reliable variance-covariance estimate.
nritchie•2mo ago
A handful of the comments are skeptical of the utility of this method. I can tell you as a physical scientist, it is common to make the same measurement with a number of measuring devices of differing precision. (e.g. developing a consensus standard using a round-robin.) The technique Cook suggests can be a reasonable way to combine the results to produce the optimal measured value.
sfpotter•2mo ago
I'm not a physical scientist, but I spend a lot of time assessing the performance of numerical algorithms, which is maybe not totally dissimilar to measuring a physical process with a device. I've gotten good results applying Simple and Stupid statistical methods. I haven't tried the method described in this article, but I'm definitely on the lookout for an application of it now.
shoo•2mo ago
I wonder if this minimum variance approach of averaging the measurements agrees with the estimate of the expected value we'd get from a Bayesian approach, at least in a simple scenario, say a uniform prior over the thing we're measuring and assume that our two measuring devices have unbiased errors described by normal distributions.
jampekka•2mo ago
At least in the mathematically simpler scenario of a gaussian prior and gaussian observations, the posterior mean is computed by weighing by the the inverses of variances (aka precisions) just like this.

https://en.wikipedia.org/wiki/Conjugate_prior

ogogmad•2mo ago
To add, for anyone who's followed the link - that's entries numbers 1 and 2, or "Normal with known variance σ²" and Normal with known precision τ", under "When likelihood function is a continuous distribution".

Also, note that the "precision" τ is defined as 1/σ².

geon•2mo ago
Like a Kalman filter?
ninja3925•2mo ago
This seems to be incorrect. The correct way to combine measurements with various degree of precision is to use the inverse variance weighting law
kgwgk•2mo ago
Unless I’m missing something that’s exactly what is proposed:

t_i Var [X_i]] = t_j Var [X_j]

pvillano•2mo ago
What's the goal of this article?

There exists a problem in real life that you can solve in the simple case, and invoke a theorem in the general case.

Sure, it's unintuitive that I shouldn't go all in on the smallest variance choice. That's a great start. But, learning the formula and a proof doesn't update that bad intuition. How can I get a generalizable feel for these types of problems? Is there a more satisfying "why" than "because the math works out"? Does anyone else find it much easier to criticize others than themselves and wants to proofread my next blog post?

WCSTombs•2mo ago
Here's my intuition: you can reduce the variance of a measurement by averaging multiple independent measurements. That's because when they're independent, the worst-case scenario of the errors all lining up is pretty unlikely. This is a slightly different situation, because the random variable aren't necessarily measurements of a single quantity, but otherwise it's pretty similar, and the intuition about multiple independent errors being unlikely to all line up still applies.

Once you have that intuition, the math just tells you what the optimal mix is, if you want to minimize the variance.

kgwgk•2mo ago
> Sure, it's unintuitive that I shouldn't go all in on the smallest variance choice.

Is it?

You have ten estimates of some distance with similar accuracy of the order of 10m : you take the average (and reduce the error by more than half).

If you increase the precision of one measure by 1% you will disregard all the others?

MITSardine•2mo ago
This all hinges on the fact the variance is homogeneous to X^2, not X. If we look at the standard deviation instead, we have the expect homogeneity: stddev(tX) = abs(t) stddev(X). However, it is *not linear*, rather stddev(sum t_i X_i) = sqrt(sum t_i stddev(X_i)) assuming independent variables.

Quantitatively speaking, t^2 and (1-t)^2 are always < 1 iff |t| < 1 and t != 0. As such, the standard deviation of a convex combination of variables is *always strictly smaller* than the convex combination of the standard deviations of the variables. In other words, stddev(sum_i t_i X_i) < sum_i t_i stddev(X_i) for all t != 0, |t|<1.

What this means in practice is that the convex combination (that is, with positive coeffs < 1) of any number of random variables is always smaller than the standard deviation of any of those variables.

pixelpoet•2mo ago
In computer graphics we call this multiple importance sampling, and it's critical for making robust estimators.
nmca•2mo ago
This is also a nice way to combine the ratings of a number of noisy annotators with variable annotations noise.
KolenCh•2mo ago
This is equivalent to inverse variance weighting. For independent random variable, this is the optimal method to combine multiple measurements. He just used a different way to write the formula and connect that to other kinds of functions.

He also frames it as a different goal too: normally when we (as a physicist) talks about the random variables to combine, we think of it as different measurements of the same thing. But he didn’t even assume that: he’s saying if you want to have a weighted sum of random variables, not necessarily expected to be a measurement of the same thing (eg share same mean), this is still the optimal solution if all care is minimal variance. His example is stock, where if all you care is your “index” being less volatile, inverse variance weighting is also optimal.

As I’m not a finance person, this is new to me (the math is exactly the same, just different conceptually in what you think the X_i s are).

I wish he mention inverse variance weighting just to draw the connection though. Many comments here would be unnecessary if he did.

jgalt212•2mo ago
The primary problem with this method is that while one correctly assumes one cannot forecast future returns, it incorrectly assumes one can correctly forecast future volatility of those returns. To be sure, Vol / variance of returns is more predictable than returns, but it's not perfectly predictable.