Hacker Newsnew | past | comments | ask | show | jobs | submit | signalsmith's commentslogin

Some stuff is around the web, some is from other people. Particularly for classic kit, someone's usually analysed it before, but it's not always in a good tutorial kind of form. Personally, I did a lot of messing around with audio/programming from my early teens onwards, and built my intuition about how the maths and sound link up from years of tinkering without many reference resources.

A lot of this stuff can be made from relatively simple building-blocks though, and you don't have to copy a previous configuration. My thought process was pretty much exactly as written in the blog-post! I just wanted to make something which didn't require any special tuning skills.


*EDIT*: I just realised that the demo you're talking about doesn't include the "early reflections"! So that demo only includes echoes which have gone through the main feedback delays at least once.

If you mix in some of the diffused signal directly, it bridges the gap between the initial sound and the feedback echoes: https://signalsmith-audio.co.uk/writing/2021/lets-write-a-re...

---

You can tune the diffuser to have an almost-instant onset. I can't remember what I did last time, but at a guess, having the largest diffuser stage increase by a factor of N (number of channels) instead of 2 might do it.

But also, if you're playing acoustic drums in a big space like a concert hall (instead of a long one like a staircase), the first echoes coming back from the walls are actually a bit delayed (1 foot ~= 1ms, at the speed of sound). So if your nearest wall is 10ft away, the first wall-echoes will come 10-20ms after the initial direct sound.


Given the number of connections/nodes in my design, I'd be interested to know what the performance is.

For Web Audio, there's an increasing trend of compiling WASM and running it in an AudioWorkletProcessor, which is maybe 2-3x slower than native. It's actually how I do a lot of my prototyping now, because the Emscripten build times are faster than a full plugin, and I can send it to people without them having to install anything.


Haha, yeah - although their comment was only considering the 2D case, same as the book.

You can make a (very efficient!) diffuser from 2-channel rotations, but you have to tune it a bit to get it smooth without having a slow attack. With more channels, it's much easier to get right.


Whoah - the author (Signalsmith) here! This was a fun way to wake up, and I'm happy to answer any questions.


Brillant article! Thanks!

Are you also "Geraint"? (The home page https://signalsmith-audio.co.uk/ says "we" but the Geraint page https://geraintluff.github.io/jsfx/ says "I"...?)

Geraint's plugins are a great collection of excellent (and free) effects for Reaper, with a superb GUI (which isn't easy to do in Reaper/JSFX). So thanks also for this! ;-)


Yes, I'm Geraint. :D I'm the tech side of Signalsmith Audio, and my partner is the Business Brain. The JSFX plugins are mostly from before we made a proper company (back when Signalsmith was just my username) - I'm glad you're enjoying them!


Do you do anything with hardware/microcontrollers? I dabble in the daisy/rasbpi world for synthesis and effects, but have always just used off-the-shelf reverb in the chain and things like teensy audio are fine but not especially great (specifically things like shimmer reverb)


I'm not really a hardware person, although at this point I've done a couple of guitar-pedal projects. My favourite is to write OS-independent C++ DSP classes, and work with a team/client who handles the gnarly build/signatures/UI/embedded stuff.


That makes sense.

> I'm not really a hardware person

Neither am I, most of the fun is in the software anyway. The rest is just some amateurish solder work and compiling an array of components I may or may not use.


Ah, excellent! Congrats again!


Thanks for the enjoyable article!

Possibly off-topic, but I am coder with hobbyist interest in the DSP space. I have never really had a "penny drop" moment when it comes to starting from nothing and generating sound.

Even generating simple sine wave seems like either a big chore or a completely abstract concept (depending on the tools/libraries/environment), I have not been able to find a middle-ground where I feel like I am learning but not getting completely lost in trigonometry or calculus. I am not sure if I'm not using the right tools or if I need to start even simpler and build up. GNU Radio comes close to scratching an itch for me of generating signal processing pipelines and a bit of intuition, but ultimately it becomes pretty easy to get lost in that as well (and it seems mostly focused on actual radio use-cases).

Do you have any advice for someone looking to build more familiarity or intuition on this front?


First, join a good community! If you're on Discord, TAP is great: https://discord.gg/aBghGGcfYs - it's beginner-friendly while also having some heavy-hitters in there, and it's generally wholesome. You're not the only hobbyist learner, and it's important to have a place you can ask questions without feeling awkward.

If you swap language/environment later, you'll carry your understanding/intuition with you, so you don't have to start with C++ if that's not your bag (even though it's still the industry standard). There are audio-specific languages with JIT runtimes (which can be used in Logic/Reaper/GarageBand/etc.), Rust/JS frameworks, etc. so find the one that feels good to tinker with, and keep that momentum/motivation going. :)


Thank you for the advice!


You could start with making sounds using a software synth or PureData. There will be no issues with generating sine waves. And there are lot of tutorials for this.

If you aim for performance, you will have to use SIMD and language that supports it (for example, C, Rust).


Thanks for this! Your reaper plugins were a great inspiration for me to learn JSFX and make my own effects. I was pleasantly surprise to see you're still sharing things with the community when I stumbled onto your talk about pitch-shifting at ADC :) Glad to have found a whole blog to explore! Thanks again :)


Thanks for writing so many blogs. The adc talk was also great. Have you considered doing some demos with wasm on the web? Also, have you considered porting these packages to rust?


I haven't done anything with Rust yet, but it's on my free-time wishlist.

I'm working on WASM demos! I've been playing with WASM builds of my plugins, and it's great for prototyping/sharing, but it could definitely be set up better for demos/teaching: https://signalsmith-audio.co.uk/tmp/web-audio/?url=/tmp/basi...


FWIW, this is my implementation of this reverb in Rust: https://github.com/cornedriesprong/cp3-dsp-rs/blob/main/src/...


Not a question but, really cool articles on your page, cheers :)


Thanks for this, Geraint! I've been trying to get a better understanding in programming for DSP, and blog posts like this are a big help with that.

I have subscribed to your blog.


Thanks so much for taking the time to write this up clearly. I now have a much better understanding of how recent work than I did before. Really appreciate it!


Care to offer feedback on my 8-band EQ implementation for OBS?

https://github.com/phkahler/obs-studio/tree/eq8

It got rejected but only because they don't want the feature. My implementation does seem different to most which I think use band-pass filters instead.


Nothing to ask, really. Just saying thanks for a fantastic intro to reverb, that I used as one of the sources to implement my own. Hope to see more audio processing educational material.


Do you happen to know the basis of state of the art reverb algorithms such as the one used for the Bricasti? Are there any clues as to how they work, or are they completely proprietary black magic?


I don't know anything about proprietary reverbs, I'm afraid - particularly hardware units! Sometimes you can tell things about a reverb's internals by looking at impulse responses, but I've always had more fun designing something from scratch.


One of my favorite things I've ever found on the internet is the "Reverb Subculture" thread on GearSpace. https://gearspace.com/board/geekzone/380233-reverb-subcultur...

It's a discussion of some of the finer (and coarser) parts of reverb design and includes comments from Casey Dowdell (Bricasti), Sean Costello (Valhalla DSP), Matt from LiquidSonics, Urs Heckmann (u-he), Chris from Airwindows, Stian (Acon Digital) and other top-notch audio DSP gurus. They're not giving away trade secrets but there are fascinating discussions around reverb design, topology, theory, and of course perception.


OP here - fairly nervous about posting this, but just to give some context of where this is coming from:

A decade ago, I got interested in JSON Schema, and at the time there was no JavaScript validator. I quickly knocked one together and shared it. It took a couple of hours, and was 460 lines plus a bunch of tests.

Only a few years after that, it had grown into a much bigger project. Other people were contributing, but I was still the lead developer. I had my own personal life going on (and other projects), and started to feel tied to this thing, like I wasn't allowed to leave. I wanted to be a responsible maintainer, but it wasn't fun any more.

Maybe someone with more experience (or a different brain) could have sustained this project indefinitely, but I eventually hit open-source burnout. I didn't sign into GitHub for several years, because I couldn't handle seeing the little notification icon. In retrospect I should have stepped back in a more proactive way (reaching out to regular maintainers first, and then putting a notice on the repo if nobody stepped up), but by the time things got bad I couldn't face it.

The license had standard boilerplate saying: THE SOFTWARE IS PROVIDED "AS IS" - but that's a legal disclaimer, not a social one. The package was (and still is) being downloaded millions of times per week on NPM, and those people had a (reasonable!) expectation that a popular and relatively-established package would be maintained, and bugs would be fixed.

There's a tension between the two sides, and this discussion has happened a few times recently. Some open-source developers want to provide reliable tools, and some others say "this is free work, you shouldn't expect anything". Some open-source users say "you published this, so you wanted me to use it, and that comes with obligations", and these disagreements can get quite heated.

Sharing code is fun, but I think the default assumptions should have more explicit limits, and a natural path to stepping back. I'm not fixated on this particular format, but I would like to see what happens if a missing SUPPORT.txt raised as many questions as a missing LICENSE.


A few questions that I anticipate:

--- Shouldn't you find a replacement maintainer?

That's ideal (and compatible with this proposal), but it shouldn't be a requirement for stepping down.

--- Couldn't you just update the README when a project's inactive?

It would be good housekeeping to periodically do this for stale projects, but that's quite pro-active. Plus, it only tells users when it's too late - it doesn't give them any sense of how soon that might happen.

(Also, the latest commit or "last publish" for packages might be misinterpreted as an active contribution.)

--- How could anybody build on a project that has a finite lifetime?

We're already living with that uncertainty, it's just invisible.

And as I said in the README: "If you need stronger guarantees, you may need to produce/negotiate them yourself". If an open-source dependency is essential to your project, then it's not unreasonable to have a support agreement in place, or have a plan for who'll do buxfixes if the maintainer steps back.


As always, there is a relevant XKCD: <https://xkcd.com/2347/>


This is off-topic, but I really like the current GOV.UK (several years old now). I don't really have opinions on the visual stuff, but I find it really pleasant to use.

Filing my self-assessment tax return (only required because I run a side-business) is a fantastically straightforward experience. Step-by-step information entry, pre-filled with what they already know (e.g. main employer's salary), then they give you a number at the end which you pay by card.

Having done the paper version exactly once before moving over to doing them online, I feel grateful every time I see that distinctive custom font.


As a US guy, I've never looked at this site before. The extreme clarity of pages like https://www.gov.uk/vat-rates is really refreshing.


Indeed, that's a nice example. I felt the design could even improve public relations. If I were a UK citizen, I'd be relieved to find the information so well-designed and presented.

I've read here and there about the UK Government Digital Service, and have a very good impression. Reading a recent related article, it sounds like they have their priorities right!

https://gds.blog.gov.uk/2019/11/05/transforming-gov-uk-the-f...


The UK has long been an early adopter of proper web design for government websites.

Seeing the average Canadian gov website, and hearing stories from people who've worked on some at the federal level, makes my head hurt.


The Canadian and provincial governments are getting better though. See the OSAP (Ontario Student Assistance Program) application page, which is fully mobile and vastly simplified from the hot mess it used to be. Also, just look at https://ontario.ca in general, which is clearly inspired by Gov.UK.


All it takes is one group to do it right and everyone wants to copy them.

Good job UK, this Ontario site looks like a semi rip-off of the gov.uk sites (which is a good thing).

Everything slowly gets better online, it just takes time.


In Germany, I can't even find the VAT rate info page at the ministry via google. I end up with this: https://www.bundesfinanzministerium.de/Web/DE/Themen/Steuern...


Fantastically straight forward? I strongly disagree. I've done the SA many times, and trying to find out your balance or payments list or anything useful is now a kafka-esque nightmare. Last time I knew they must owe me money but they didn't say at the end, and it took me about 15 minutes to find out how much, with no indication of when it would arrive. At the end of the SA they even had some sort of message saying make sure you pay what you owe, which turned out to be nothing. This is all complicated because you pay on account, paying the next year's tax 15 months before you submit your return (they guess your next tax bill based on the previous one, as you don't submit the return for 9 months after the end of the tax year, so you don't get in too much credit).

The new SA process is no different from the old one, with minor cosmetic enhancements, but they've made it almost impossible to get to the old account sections.

Notice how there's no login button. On a website that relies on logging in. Now search for "self assessment login" or "self assessment account" or "self-assessment balance".

See any login button? See anything resembling a login? last year you could still get to the old account screen after some hunting, but that's gone now. The new account screen is a mass of text with links sprinkled through out, where the old one was a compact menu.

Plus, when you finally do find your accounts, you can only see one year at a time, have to use a drop down to change year, the amounts you owed are on one page, they amounts you paid are on another, some of these figures are still provisional, and nothing adds up.

As for submitting your company accounts, what a joke that used to be when they re-did it. I knew exactly what type of account I needed to submit. But to get to that form, I think they had a labyrinth of 16 web pages, each just one question per page, that you had to answer while they unhelpfully tried to pick the form you needed for you. Get the wrong form? No way to go back to see what answer you got wrong, no way to fix it, you just had to start again. It meant I had to go through it 3 or 4 times before I finally got the right form.

Before they "renovated" it, you just picked the form you needed.

They even did a whole blog post about how great the one page per question concept was, which turned out to be utterly bullshit.

I've lost all faith in the gov.uk team, I feel they're trying too hard to be cool and "innovative". They have thrown out convention, and are often making poor UIs and user journeys because of it.


I’m biased, I used to work at GDS.

The lack of a ‘login’ button is a huge issue IMHO, but the main blocker to it isn’t the tech teams, its at the ministerial/senior civil service level.

The problem isn’t the button itself but the infrastructure behind it. I.e. it requires a single database of users (i.e. a national register of citizens).

This needs doing, but politicians come out in hives because it involves setting up a system similar to national ID cards (politically difficult). Senior civil servants dislike it because its a question of which department owns it, if its GDS its the cabinet office, and that means the Home Office, DWP, HMRC surrendering some control (i.e. being increasingly dependent on external systems), which is something departments seem to dislike.

It’d save millions (billions probably) in the long run, but there isn’t the political will to do it. It would need an influential cabinet minister to push it through and would take 3-5 years to get properly embedded.


Finding where to login for SA is the one frustration I have with SA right now. Everything else works really smoothly, but I have to resort to Googling "self assessment login" every time.

Solving this doesn't require a unified login - it needs proper signposting within gov.uk of the most likely user flows. Right now, finding the login for SA is something like 5 levels deep within the hiearchy of pages, and even then it's not well signposted.

gov.uk -> "Money and Tax" -> "Self Assessment" -> "Register for and file your Self Assessment tax return" -> Sign In

Having to choose "Money and Tax" and then "Self Assessment" is fine. But then you're faced with an enormous menu of choices, only the 19th of which leads to a login prompt. Once you've reached that page, "Sign In" isn't even at the top of the page - it's below the fold on my 1440 pixel high screen!

Just putting common tasks at the top of the list, with everything alphabetised underneath for when you're looking for something specific would make a huge difference.


I get what you’re saying I have the same problem with SA, but the key is better personalisation, which login can help with.

Gov.uk provides hundreds of services, like SA, which each user will only use a small subset of. That subset will be different for each user. I now need SA whereas 5 years ago prominently signposting that would have been useless to me. For others education services, welfare services and health should be highlighted. All this is quite difficult without knowing who is accessing the site.

Though In the specific case of SA, I think its not as well conceived a service as it can be. 95% of the time i’m not ‘registering for self assessment’ or ‘filing a self assessment tax return’ , i’m ‘checking what tax i owe’


> it involves setting up a system similar to national ID cards

No it doesn't. We have a register of everyone resident or tax paying here in Norway and no ID cards. The government keeps on trying to make ID cards happen but the relevant departments always seem to be dragging their feet.

You already have a national register in the UK: National Insurance numbers. The difficulty is that it is simply not properly joined up with taxes, banking, etc.

I very much doubt that there is any serious political objection to joining these databases amongst the general public; as you say the civil service departments feathering their own nests is the biggest problem.


Its seen as setting up a system similar to national ID cards.

Weirdly National Insurance numbers are not always unique, and people can have more than one. Also while they are used by for tax and benefits (HMRC and DWP) other departments have a different ID number, the biggest being NHS numbers, military service numbers, passport numbers and driving license numbers (DHSC, MOD, Home Office, Department for Transport). So you’d need to unify it, under one of these, effectively creating a ‘National ID Number’, even if you don’t call it that it’d be spun as that by opponents (libertarians, big brother watch etc). You’re probably right in that the public probably aren't too worried about it, and would probably be appalled to see the waste that goes on as a result of it not existing. But politicians and parts of the media will get riled up by it.


> would probably be appalled to see the waste that goes on as a result of it not existing.

There's no probably about it. I breath a sigh of relief every time I get back home to Norway after visiting family in the UK (which I left 34 years ago). So much is just simpler here.


In this case, the fallback is still a plain-text field, into which the user should enter numbers. Perfectly usable, but without the keyboard hint, so it seems like a graceful fallback to me.


For me, I really appreciate the Bayesian approach because it makes it very explicit that you pick a prior.

Perhaps my experience is limited, but every (supposedly non-Bayesian) model I've used in practice has been possible to re-express using Bayesian terms, priors and beliefs and so on. Then I get to look at the intitial assumptions (model/prior) and use suitable human hand-wavey judgement about whether they make sense.

Bayes is a good way to _update_ models, but if you lose sight of the fact that the bottom of your chain of deduction was a hand-wavey guess, you're in trouble.


> it makes it very explicit that you pick a prior

But you don't, in general, pick a prior. You pick a procedure that has an expected loss under various conditions. It's one player game theory.

If you happen to have a prior, then you can use it to choose a unique procedure that has minimal expected risk for that prior given the loss function, but even so that may not be what you want. For example, you may want a minimax procedure, which may be quite different from the Bayes procedure.


Minimax still requires a probability distribution, which means you need a prior.

Edit: Based on the downvotes, I see my audience is not convinced. I'll repeat an explanation I posted a while ago. Probably should make this a blog post because I see this claim quite often. I'd love to know what book you read it in.

--

In minimax regret, you have a set of available decisions D, and a set of possible states of nature N, and a utility U(D,N). Each state of nature also has a probability P(N) (which can be influenced by the decision too in some problems).

States of nature include "interest rates rise 1%", "interest rates fall 1%", and "interest rates stay the same". Decisions include "invest in stocks" and "invest in bonds".

Minimax regret proposes to ignore the probabilities P(N), instead suggesting a way to make a decision purely based on the utilities of the outcomes. But that is actually an illusion.

Outside of math class word problems, we don't have N or U(D,N) handed to us on a silver platter. There is always an infinite range of possible states of nature, many of which have a probability approaching but never reaching zero, including states such as "win the lottery", "communist revolution", and "unexpected intergalactic nuclear war".

In commonsense decision-making we don't include those states of nature in our decision matrix, because our common sense rules them out as being implausible before we even think about our options. You wouldn't choose to invest in bonds just because stocks have the most regret in the event of a communist takeover.

So what actually happens is we intuitively apply some probability threshold that rules out states of nature falling below it from our consideration. Then we minimize max regret on the remaining "plausibly realistic" states of nature.

Humans are so good at doing probability mentally that this step happens before we even realize it. But if you are writing code that makes decisions, you'll need to do it, and so you'll need to have at least a rough stab at the probability distributions.


Conceptually you are right: all mathematical models have assumptions, including assumptions about their scope of applicability.

But you are redefining "prior" to refer to all the assumptions of the model, and not its usual meaning as the prior distribution used in Bayes calculations.


Prior distribution is P(N|I), where I is the background information you have such as "historical interest rates in the USA looked like this", and "communist revolutions occurred 6 times in the 20th century" (made-up number). I is not itself the prior.

For this investing example, it's also the only information we have, unless we're trying to update on something like a central bank announcement. So our probability distribution over N is just the prior distribution.

When you're actually trying to make a decision, and not just solving a problem handed to you in math class, you can't avoid using P(N). You can either say "The minimax procedure requires knowing P(N) as an input, so that it isn't dominated by extremely improbable N", or you can say equivalently that "Minimax doesn't require P(N), but as an assumption of my model I'm ignoring all states of nature N with P(N) < y, then applying minimax regret over the remaining N".


I think we must be coming from two different communities of practice where the words don't quite line up. All the operational things you are saying I agree with. I just put them under different verbal categories.


"There is always an infinite range of possible states of nature"

Well, I think that is definitely and unambiguously false. The universe is not infinite, nor infinitely divisible, as far as we know, and the number of future states of any particular person (or humanity) are even smaller than those of the universe. Limits in time mean limits in space, and limits in space mean limits in particles and possibilities.

I'm not sure I can make a case that it matters, but if it doesn't matter, why say infinite?


I guess this is a tangent. First of all my point really doesn't hinge on the infinity; it can be finite (but really big) but regardless, whenever you apply minmax you must first crop your decision space to a probability threshold, or else you'll make nonsensical decisions based on what gives the best outcome if the sun should happen to explode.

But secondly, I think (although I'd happily concede if convinced otherwise) that the space of possible scenarios really is infinite, even if the observable universe is not. The space I'm talking about is not the actual state space of the universe, which in some interpretations of physics might be finite or even unitary. It spans the space of hypothetical universes that are all consistent with your information with nonzero probability, which I think is probably infinite, but again, if it's not infinite that's a technicality. If you include the states that have with zero probability (because why not? GGP was advocating that the probability is irrelevant to minmax decisions) then the space is definitely infinite, because even physically impossible states of nature will impact our decision making.


Another way to conceptualize the "cropping" is to get rid of all future states where planning would have been meaningless anyway.

We are momentary Boltzmann brains? We'll assume not, because if so, nothing really matters.

Trivial difference, but that avoids potentially difficult threshold problems and cousins of the St. Petersburg paradox or even Pascal's mugger, at the risk of being slightly more hand wavy.

Arguably an aesthetic distinction at this point, I generally think your description and approach are right.


>Well, I think that is definitely and unambiguously false. The universe is not infinite, nor infinitely divisible, as far as we know...

This seems wrong. We don't know whether the universe is infinitely divisible.

See this for a nice discussion: https://physics.stackexchange.com/questions/33273/is-spaceti...


I think it's sophistry to pretend we haven't any more idea of that since pre-Democritus. Thousands of years of science has shown that infinities are always a problem in our heads, with our theories. Does that prove they don't exist? No more than it's proven that the sun will come up tomorrow, I guess.


Just to be clear why this whole conversation thread is a TypeError, let's say I assign a probability of 99.9% to the hypothesis that the state space of the universe is finite, and 0.1% to the state space of the universe being infinite...

... In that case, how big is my hypothesis space about possible states of the universe?


If you had a blog of thoughts along these lines I’d subscribe.


Not as of yet but hopefully soon! Thanks for the encouragement =)


What if you assign a probability of 0.1% to the possibility of 2 + 2 = 5?



There are plenty of examples of inifinities that are not problematic. Infinitely small wavelengths make our current understanding of physics break down, indeed. Or maybe infinitely divisible solids that lead to paradoxes like Banach-Tarski's. On the other hand, infinitely dimensional configuration spaces or continuous parameterization (e.g. coordinates, field strengths, phases) are trivial unoffensive parts of classical and quantum mechanics.


So you agree with Aristotle that there are only potential infinities, no actual infinities?

Do you agree with Aquinas’ corollary, that absent an actual infinity, there must be some First Cause, which we call God?


> Do you agree with Aquinas’ corollary, that absent an actual infinity, there must be some First Cause, which we call God?

Note that even if you agree with Aristotle’s position, which is essentially an arbitrary assumption, and the corollary that there must then be a first cause, there's nothing except the boat of being stepped in a particular religious tradition to suggest that the first cause should have any of the other traits of any particular concept of God. It works just as well to take the earliest known thing on the sequence of causes and say “this cause is uncaused”.


In modern times, we actually call it Big Bang.


Aquinas' argument is that there can't be an actual infinity, so even though it appears that everything has a prior cause, it must be that there is something which is self-causing. "The Big Bang" qua event clearly didn't cause itself (events only cause events that are later in time), so the typical way to cash this out is "the Big Bang" qua set-of-physical-laws is self-causing.

This leads to a new problems (why this set of laws vs. some other), unless you posit that the laws are somehow perfect or necessary (which is essentially Deism), but the laws of our universe seem to be contingent (lots of unexplained physical constants).

You can make a metaphysically plausible case of a Big Bang-Big Crunch cycle that goes on forever, but then you're back to believing in an actual infinity.


> This leads to a new problems (why this set of laws vs. some other), unless you posit that the laws are somehow perfect or necessary

Those problems are only problems with the aesthetic preference that the universe be perfect or necessary. Once you accept that the universe can be without adhering to any such aesthetic preference, they cease to be problems.


So then the universe existing is a brute fact with no cause (as opposed to being self-causing).

You can do that but once you say there are facts without causes it's hard to know what you're signing up for. Why is this the brute fact and not something else? By definition, there is no answer (no cause) for that question. Uh okay, but if brute facts are possible, how can we do science at all? For all we know, we're just surrounded by brute facts and attempts to systemize facts into theories is just a waste of time because a new brute fact can just come along and bite you in the ass tomorrow. But I thought we only posited brute facts because science was pushing us in that direction by show us that there was a Big Bang, but now suddenly we're told "science is only contingently possible and sometimes just fails entirely due to the existence of brute facts".

It's not a satisfying intellectual stance, and if you really poke at it, it just feels like motivated reasoning in which the conclusion (there is no God) is leading the premises (some facts have no causes), not the other way around.


Heh, this conversation sounds like one I once had in university.

Here's the secret: Causality itself, that is, the notion that things have causes and A-->B (A causes B), is a concept that only makes sense within a system that has causal laws of physics and, in particular, a notion of ordering such as time. It applies to "event"-type objects such as A and B.

Since we humans live within a universe governed by causal physics, with a sense of order given by time and entropy, we observe events always having causes. But this is a property of events within our universe.

To ask whether the universe itself has a cause is a reasonable question, but to assert that it must have one, due to causality, is another TypeError. Universes, as a class of objects, are not governed by the same laws of physics as things within a universe. Time itself is in a sense a member variable of our particular universe, remember. So universes are not subject to causality any more than they're subject to gravity. Causality and gravity both apply to things within universes.

It might be that there are other laws that govern the formation and structure of universes. But we won't be able to infer very much about them by performing experiments within our universe.

To help you visualize this concept, think about a cellular automaton like Conway's game of life. That game has particular laws of physics, and can run on a PC. The evolution of the game state, though, is not closely coupled with the PC's environment. The PC can pause the game, or run it at 100x speed, or run it backward (if it has reversible laws; Conway's doesn't), but from the in-game perspective, it wouldn't be noticeable. Within the game, it would perhaps be possible to perform experiments to discover the governing rules of the cellular automaton, but there's not really many experiments that a one could do within the game to learn about how the PC works.

You can even build a Turing machine within the game, and have it run another kind of program. There wouldn't be a way for an AI within that program to distinguish that the Turing machine running it exists as a cellular automaton, as opposed to any other Turing machine, let alone to discover the PC at the upper level.

There's no reason to think that the same laws of physics apply at higher abstraction layers, and so it's entirely possible that our universe has no cause, because causality itself is an in-universe concept.


You agree with Aquinas; you just also agree with Spinoza and think that the Universe is God.


In my analogy, God (if used a meaningful term with all the cultural baggage that it carries) maps much more closely to John Horton Conway than to either the universe or the PC. I'm not asserting that Conway does or doesn't exist, merely that a Game of Life does not necessarily imply a Conway.


> You can do that but once you say there are facts without causes it's hard to know what you're signing up for.

Once you start inventing unjustified entities to satisfy an aesthetic preference for things (except the invented entities!) to have causes, you know what you are signing up for—a perception of reality driven by your desires rather than justified belief.

That the universe exists is a fact. The question of whether the existence of the universe has a cause may not be answerable, and there's a pretty good argument that it asking what the cause of the universe existing is itself is as incoherent as asking what the color of 1+1 is. To assert anything as a prior cause of the universe is to assert an entity outside of the universe, which is just equivocation because the “universe” in the question is the sum total of all existence.

> Uh okay, but if brute facts are possible, how can we do science at all?

Quite easily.

> For all we know, we're just surrounded by brute facts and attempts to systemize facts into theories is just a waste of time because a new brute fact can just come along and bite you in the ass tomorrow.

Of course, that's the fundamental nature of science. It's always contingent, but we build on what has observed predictive utility, because if there are any systematic rules, that's the only even loosely objective way to discern them. Accepting that scientific knowledge is inherently contingent doesn't prevent doing science.

> It's not a satisfying intellectual stance

Satisfaction is subjective; clearly, it doesn't appeal to your aesthetic preferences.

> and if you really poke at it, it just feels like motivated reasoning in which the conclusion (there is no God)

That's not the conclusion. Rejecting a particular argument for the necessity of a First Cause (which, while it gets abused as one, wouldn't be an argument for the necessity of anything much like the image of God it is used to justify even if it was valid on its own terms) isn't the same as denying the existence of God (I'm, as it turns out, a Catholic who quite firmly believes in God, so the distinction is not merely theoretical.)

> is leading the premises (some facts have no causes),

That's not the premise, either. Rejecting as unwarranted the assertion that all facts must have causes isn't asserting the existence of uncaused facts. (Though the argument from First Cause is asserting the existence of uncaused facts, so it's kind of odd for someone defending that particular God-as-brute-fact argument to mock the—imagined, but not actually real—premise of others that brute facts exist.)

Of course, St. Thomas Aquinas’ argument (and the similar though different previous effort at proving the logical necessity of God by St. Anselm) are the actual motivated reasoning in the debate, not the rejection of those arguments.


We already believe from quantum mechanics that there are random events that have no prior cause going on all around us. Even creation ex nihil seems to be going on constantly at the smallest scale, with virtual particles popping in and out of existence governed only by laws which ensure the conservation of energy.

So, whether correct or not, our scientific understanding already posits effects without causes. Ascribing no cause to the big bang itself is then not an extra assumption, so no contorted logic is necessary to get rid of the First Causer.

And related to your description about brute facts - while perhaps unsatisfying, I believe that it is how many scientists do perceive the world. We have a set of observations and we try to come up with the simplest set of laws that describe these observations, and test their predictive power on new facts as they come along. Sometimes, we discover that our set of laws had some hidden assumption that we were not aware of, such as the surprising facts about the speed of light being constant when measured from moving vehicles leading to the realization that Newton's laws of motions only hold for small enough speeds, and the need for general relativity to accurately describe what happens at a larger scale.

Even today, we have clear, well known gaps in our scientific understanding: the standard model only applies for matter at certain energy levels; quantum mechanics only applies at certain scales and can't take into account gravitational effects; we have mathematical singularities that come up when trying to describe black holes, which are unlikely to be physically correct; and we don't know what most of the matter in the universe is made of; and I could go on.

Scientific understanding is known to be contingent and any day a new unexpected fact could be observed, toppling our understanding of the laws of physics. That is a well known and inescapable fact.

All of this is not to mention that it still seems disingenuous to call the posited First Cause 'God', bringing to mind YHWH. I would be more inclined to accept the idea that there is some kind of transcendental First Cause (though, again, I don't think that is a particularly necessary concept), but you would need many more arguments to go from that to any particular conception of god.

Also, all of this discussion relies on certain assumptions about the real world and our ability to perceive it. For example, physics is also entirely compatible with the Hindu notion of Maya, that the world is an elaborate illusion, with everything we perceive actually being like drops of water in the ocean that is God, Brahman. Not to mention that even our understanding of logic is contingent. Perhaps there is some limitation of our biological brains that prevents us from seeing some fundamental flaws in our arguments.

All in all, my point is that it is not possible to obtain true certainty beyond any possible doubt on any topic. The best we can do is choose some base assumptions we believe in, and try to see what we can understand of the world starting from those. And if you chose God as one of those base assumptions, that is perfectly legitimate, and you can get a coherent model of the world that includes it. But you can't convince someone who has chosen pure empiricismaas their base assumption of the necessity of this base assumption.


Are all priors an application of Bayes's theorem?

It is confusing to me that there is talk of Bayesian statistics vs. frequentist statistics when both are often used in conjunction. The classic example of a medical test with false positives and false negatives and the prior being incidence in the general population comes to mind. To me that is not just an example of Bayes, but a combination of frequentist statistics with Bayes's theorem.

I also seem to recall that Bayes's theorem appears in a standard first year probability and statistics course.


Bayesian statistics: the parameters you want to infer are modeled as random variables with a non-empirical prior, and Bayes' rule is used to draw inferences.

Frequentist statistics: you construct estimators for the parameters you care about, subject to appropriate loss/risk criteria, but without any explicit "prior knowledge".

Frequentist statistics with Bayes' theorem: you use available empirical data, plus some exponential-family distribution, to construct an informed prior, then use Bayes' rule to update the prior on evidence. You use this Bayesian approach only for unobservable hypotheses, rather than for parameters which can be estimated.

Machine learning: you stack lots and lots of polynomial regressors onto each-other and train them with a loss function until they predict well on the validation set.


A more charitable take on machine learning: you decide that your criterion is predictive accuracy, and you evaluate it on a holdout set (or you cross-validate).

The idea of evaluation on a holdout set is actually frequentist: it's equivalent to "I really want my model to work well on the true distribution, but that's unknown, so I shall approximate it by the empirical distribution of the data." The empirical distribution is the maximum likelihood fit to the data, if you allow yourself the entire space of distributions.

Compare to how Bayesians do model selection... I've seen several versions:

-- "I have a prior on the set of models, and I compute the model evidence using Bayesian principles, and thereby update my beliefs about the set of models." (This is a clean principled approach. Shame no one does it!)

-- "I compute model evidence using Bayesian principles. The model with the largest evidence is my favoured model." (This is nonsense.)

-- "I compute model evidence. I then use gradient descent to find the hyperparameter values that maximize evidence." This is what is done by all sorts of "Bayesian" frameworks, such as the Gaussian Process models in sklearn. (This is classic frequentism, but for some strange reason Bayesians claim it as their own.)

I certainly wouldn't argue that "predictive accuracy" is the be-all and end-all of modelling -- but it is a nice clean principled approach to model selection. I have honestly never seen a Bayesian who takes a principled approach to model selection.


> A more charitable take on machine learning: you decide that your criterion is predictive accuracy, and you evaluate it on a holdout set (or you cross-validate).

I'm doing a PhD in machine learning, so I quite realize. But it's Bayesian machine learning!


Could you give an example of a Bayesian statistical calculation that does not intersect with frequentist statistics (i.e., your first type)?


What do you mean by a "non-empirical prior"?


Bayesian statistics is sometimes called subjectivist statistics. Probability in Bayesian statistics reflects your degree of belief in some potential outcome.

If you conduct an experiment, you use Bayes’ theorem to update your degree of belief, which is now conditional on the outcome of your experiment.

By quantifying your degree of belief in a prior, you give yourself some starting point (rather than just assuming 0 probability), even if that prior is only an educated guess and not some well researched position. This can be good because you might not have done the research yet.


Yeah, no thanks though. I don't want every rando adding "priors" that "feel" right to their analysis. Frequentist is straight forward. Both can (and are) abused to prove bias.


The difference between a frequentist and a Bayesian is that the latter admits that he picks a prior. A frequentist smushes together (1) the statistical assumptions (2) the approximations that make the problem computationally tractable and (3) the mathematical derivations, into one big mess. Just because you're not stating your assumptions doesn't mean there are none. Consider maximum likelihood estimation. It is not invariant under coordinate transformations. So which coordinates you pick is an assumption. In fact, with Bayesian estimation you can do the same thing: picking a prior is equivalent to picking the uniform prior in a different coordinate system. So frequentist estimation does involve picking a prior by picking a coordinate system, even if the frequentist does not admit this.

Frequentist methods are conceptually anything but straightforward. The advantage of frequentist methods is that they are computationally tractable. Usually they are best understood as approximations to Bayesian methods. For instance, MLE can be viewed as the variational approximation to Bayes where the family of probability distributions is the family of point masses, and the prior is uniform.


What do you mean by coordinate transformation? MLE is invariant under parameter transformations because it's just the argmax of the likelihood.


Indeed, it is the argmax of the likelihood, but the likelihood is not invariant under coordinate transformations. The quantity p(x)dx is invariant, not p(x). By picking a suitable coordinate transformation you can put the MLE on any value where the likelihood is not zero.


MLE is not invariant under parameter transformations because it's just the argmax of the likelihood!

Take for example x~normal and exp(x)~lognormal. The maximum of the distribution is at mu for the former and at exp(mu-sigma^2) for the latter, instead of exp(mu).


Adding to the other comments, you still have prior-dependence on a more subtle level, because it depends on what hypotheses are allowed.

Here's an extreme example. Consider flipping an apparently fair coin and getting "THHT". The hypothesis that the coin is fair gives this result with likelihood 1/16. The hypothesis that a worldwide government conspiracy has been formed with the sole purpose of ensuring this result... has a likelihood of 1.

But nobody would ever declare this the MLE, because "government conspiracy" isn't one of the allowed options. But it isn't precisely because it's unlikely, i.e. because of your prior. Of course this is an extreme example, but there are more innocuous prior-based assumptions baked in too.


Wait, in frequentist statistics getting, say, a p-value of 1 is not a bad thing--unless you erroneously assume that value is evidence for your null hypothesis.

Consider that if your data generating process really is a fair coin, then the conspiracy outcome you mention only occurs 1 our of 16 times, so 15 out of 16 times you observe a likelihood of 0. 15 out of 16 times your reject the conspiracy case.

There is also a tricky component here, because the notion of sample size is not clearly defined (can we generate multiple 4-tuples of flips, and consider each one a sample? Is your example really just a funky way of discussing type II power?)


> Wait, in frequentist statistics getting, say, a p-value of 1 is not a bad thing--unless you erroneously assume that value is evidence for your null hypothesis.

That's exactly what I'm saying. Suppose you get HHTHT. Then you run the following statistical test:

Hypothesis: a government conspiracy has been hatched to make you get HHTHT.

Null hypothesis: this is not the case.

The p-value is 1/32, so the null hypothesis is rejected.

This is bad reasoning for two reasons: first the alternative hypothesis is incredibly unlikely, and second the choice of alternative hypothesis has been rigged after seeing the data. These are exactly the two reasons so many social science studies running on frequentist stats have done terribly, and why we would benefit from Bayesian stats which force you to make these issues explicit.


> The p-value is 1/32, so the null hypothesis is rejected.

No, the p-value is defined as the likelihood of a result at least as extreme as the one we obtained, under the null hypothesis. It's not simply the likelihood of the particular result you obtained, as that would always be zero for continuous quantities! (Remember that the p-value's distribution is uniform over the 0-1 interval under the null, so any criticism that says the p-value is almost always small just by chance must be wrong somewhere).

So first you need to establish a way to say what result is how extreme. This is very often trivial and quite objective (the more people cured/made sick, the more extreme the effect of the drug). For the coin flip case, one way would be to call results with more imbalanced ratio more extreme. Then in your 3 heads out of 5 case, the (one sided) p-value would be the likelihood of getting 3, 4 or 5 heads out of 5. You can also come up with a different way to define what "more extreme" means (and put it forward in a convincing way), otherwise you can just not talk about p-values. You can keep talking about likelihoods, but not p-values.


> No, the p-value is defined as the likelihood of a result at least as extreme as the one we obtained, under the null hypothesis.

Define for me in an objective way what "at least as extreme" is. Let's say I think the string "HHTHT" is extremely indicative of conspiracy. Then the p-value is 1/32 on the measure of "strings of coin flips at least this extremely indicative of conspiracy".

See, this sounds completely ridiculous, but it's not in principle any different from what it done in thousands of social science papers a year. All these supposedly objective procedures have tons of ambiguity. For example:

> For the coin flip case, one way would be to call results with more imbalanced ratio more extreme.

Why an imbalanced total ratio? Why not average length of heads? Average number of occurrences of "HT"? Frequency of alternations between H and T? Average fraction of times H appears counting only even tosses? Given the combinatorial explosion of possible criteria, I guarantee you I can find a simple-sounding criterion on which any desired string of fair tosses gets a low p-value.


> Why an imbalanced total ratio? Why not average length of heads? Average number of occurrences of "HT"? Frequency of alternations between H and T? Average fraction of times H appears counting only even tosses? Given the combinatorial explosion of possible criteria, I guarantee you I can find a simple-sounding criterion on which any desired string of fair tosses gets a low p-value.

Sure you can p-hack and people definitely do it. Still, good papers argue for any unconventional choice of what they mean by extreme.

> Let's say I think the string "HHTHT" is extremely indicative of conspiracy.

Then I as your peer-reviewer will say I require more justification for your premise. Usually what counts as more extreme is not up to each paper to define, but depends on the conventions of a field that were agreed upon by domain-level reasoning, so you don't always have so many degrees of freedom left (but still have some, that's why p-hacking is a hot topic.)

Again, you're arguing against p-hacking: coming up with your criterion for what counts as extreme after looking at your observation.

Indeed if we assume no p-hacking, things look much nicer. If for some reason you've for years argued on YouTube that there's a conspiracy to make the 5 coin tosses that person X will perform on live TV on this and this date to be biased towards HHTHT, and then it actually does end up being HHTHT on live TV, then I think it's fair to say we can reject the null hypothesis at the level of p=1/32. It doesn't mean we absolutely for eternity have rejected it, but I guess it's worth accepting a paper about your analysis and discussion (taking the analogy back to science). We're already accepting a 5% false positive ratio anyway.


>Define for me in an objective way what "at least as extreme" is.

Come up with some one dimensional test statistic T whose distribution D you know under your null hypothesis. Define a one sided p value for data x as p(t <= x).

It sounds like your statistic is 0 if the sequence is always "HHTHT" and 1 otherwise? In this case your p value is 1 unless every attempt is "HHTHT" in which case it's zero, so the test statistic is 0 with probability 1/32^k for k attempts. The more attempts you do, the smaller p gets if the null is false. It's working as intended. For this test, a threshold of p=0.05 would be dumb, but it's always dumb.

It's not an awful test assuming you came up with your test statistic and "HHTHT" before collecting your data. It meshes with the intuition of betting your friend "Hey I bet if you flip this coin you'll get HHTHT." If they proceed to flip it and see HHTHT, they are reasonable to think maybe you know something they don't.

If you come up with your test statistic after the fact, there's theory around p hacking to formalize the intuition of why it's not convincing to watch your friend flip some sequence of coins and then tell them "dude, I totally knew it was going to be that" after the fact.


A more general method is to use the likelihood ratio, ie the ratio of the likelihood of an outcome under the alternative hypothesis to its likelihood under the null hypothesis. And then pick the outcomes which for which this ratio is highest as the ones which will cause you to reject the null hypothesis. Equivalently, the p-value is the probability under the null hypothesis that the likelihood ratio would be at least this large.

This works in the discrete case too, and gives p=1/32 in the original coin flip case.


Is the likelihood ratio test more general? I thought that one of the benefits of the usual NHST framework was that you only need the distribution of your stat under the null. With LRT don't you need the distribution under both the null and the alternative? How do you frame a null of mu = 0 against an alternative of mu != 0 with x ~ D_mu in this way?


You don't necessarily need the distribution under the alternative to determine the values for which the likelihood ratio will be highest. In your example, the tails will be the areas of maximum likelihood for any (symmetric) alternative.


Huh, TIL. Thanks :)


It's strawman to always posit frequentists as unthinking blobs of meat who don't consider the credibility of the alternate hypothesis. In fact, many experimental scientists, physicists, biologists etc. made discoveries using frequentists techniques that didn't rely on boogyman notions of "want to bet the sun just burned out because you're in a closet" nonsense.


I'm a physicist that uses frequentist statistics, and it works fine. However, it can't be denied that some fields misuse it, though precisely the failure modes I pointed out.


What? Can you put in probabilistic terms what "this is not the case" is?

There are an infinite number of models where p(HHTHT | model) != 1, or where p(HHTHT | model) = 0. We need to know which one you're referring to, in order to calculate a p-value.

I think you have made a serious error by believing you can simply "reverse" the model p(HHTHT | conspiracy model) = 1, p(everything else | conspiracy model) = 0.

If the null hypothesis is a fair flip, then the alternative can't be a conspiracy, because the null and alternative need to be complementary statements. So if the null is fair flip, then the alternative is "not fair flip".

edit: whoops, changed mutually exclusive to complementary. see http://www.its.caltech.edu/~mshum/stats/lect8.pdf


The exact point I am making is that all of this is totally up to the researcher. This is the standard methodology in social science: yes, in theory a low p-value does nothing but support the complement of a fairly bland null hypothesis. But in reality that's not what people do. Instead any low p-value is taken as proof of an extremely specific alternative hypothesis.


>Null hypothesis: this is not the case.

>The p-value is 1/32, so the null hypothesis is rejected.

This is incomplete. You need to define a test statistic and know its distribution under your null hypothesis before you can come up with a p value. What's your test statistic here and how is it distributed?

If you define your test after seeing the data, of course you can come up with an arbitrary p value. Choosing a distribution for your null to make it fit an agenda is just like choosing a distribution for your prior after seeing your data to make it fit an agenda.

You could say your prior is a delta function around HHTHT after observing it and get arbitrary evidence, but anyone reading your paper will find it unconvincing, just like anyone reading about a test statistic like this will find it unconvincing.


Your mistake here is in saying that because the p-value is 1/32 you reject the null hypothesis. You just decided to do that with utterly no justification. There is a problem with people unthinkingly deciding that a p-value of .05 is reasonable is most situations but that is not actually an issue with frequentist statistics anymore then people starting out with bizarre priors would be a problem with Bayesian statistics.


"that is not actually an issue with frequentist statistics"

To me that sounds exactly like when people say everything that goes wrong with cryptocurrency in practice is not a problem with the concepts.


Not sure I follow? The hypothesis that the result you see is the result a worldwide government conspiracy is 100% supported by every result that you see. Because it is 100% consistent with the data, a statistical analysis will tell you exactly that--that it is 100% consistent with the data.


Again: Priors can and are used to mislead. Both methods can and are used to mislead. Just moving to Bayes doesn't assume the finding is free of bias all of a sudden.


It doesn't. But the workflow of Bayes forces you be explicit. If you try and cook the books, it will be shown for the world to see. Can you provide a paper that quoted a p value for a regression and also validated all the asymptotic conditions are close to being true in order for that p value to be even somewhat reliable?


If anything, Bayes increases complexity because of a variety of infinite priors that can be chosen. Frequentists is more straight forward because of the removal of this bias. A constant prior along with _actually reading the study/paper_ generally is sufficient. It doesn't preclude future testing. If anything, big discoveries in science require big scrutiny. Bayes does not add anything but complexity and another lever to tune in this regard.


Frequentist has a prior also though. The uniform distribution. In a sense this might be more biased as it doesn't always accurately describe the situation.

Either way I believe the effect of a prior diminishes greatly pretty quickly as you acquire more data. It's only a factor if you have extremely small set of data.


The uniform distribution ("flat") prior lets you interpret a maximum likelihood result as a maximum-a-posteriori (MAP) Bayesian point-estimate (implying a 0-or-1 loss function). One could argue that if you refrain from doing this and just stick to a literal application of the likelihood principle, you're not really depending on a flat prior.

For that matter, what is a "flat" prior over the parameters also depends on what parameterization you're using. Results that are 'intuitive' under one parameterization may not be under a different one.


Frequentist has a prior also though. The uniform distribution.

No. Experimental design affect frequentist conclusions in a way that is inconsistent with _ANY_ prior.

Here is a real life example. My aunt and uncle had 7 children. 6 boys and one girl. Were they biased towards having one gender over another? If the null hypothesis is that they aren't, the p-value that you get is easily calculated as 16/2^7 = 1/8 = 0.125. (There is 1 arrangement of 7 girls, 7 of 6 girls and a boy, 7 of 6 boys and a girl, and 1 of 7 boys for 16 equally likely arrangements.)

If I add the fact that they planned to have children until they had a boy and a girl, then that changes the p-value. In fact there are only 4 ways that their first 7 children can come out to give evidence this strong against the prior. So the p-value is now 4/2^7 = 1/32 = 0.03125.

However a Bayesian looks at this and says that no matter what prior you pick, the knowledge that they planned to have children until they had both a boy and a girl does not affect your posterior conclusion. It literally has nowhere to go in the formula and can't make a difference.

Therefore the frequentist's differing conclusions are not consistent with ANY prior, implicit or not.


> a Bayesian looks at this and says that no matter what prior you pick, the knowledge that they planned to have children until they had both a boy and a girl does not affect your posterior conclusion

A Bayesian would say no such thing. A Bayesian would agree that the knowledge that they planned to have children until they had both a boy and a girl doesn't affect your prior: you still are picking how much probability mass you allocate to all of the possible odds of having a boy vs. a girl, and the couple's plans don't affect that.

However, a Bayesian would also say that the knowledge that they planned to have children until they had both a boy and a girl significantly changes the likelihood ratio (or p-value, if you prefer to use that) associated with the observed data. And one of the advantages of Bayesianism is that it forces you to make that explicit as well.

Notice, for example, that when you calculated the first p-value of 1/8, you implicitly assumed that the couple's plan was "have 7 children, no matter what gender each of them is". The sample space is therefore all possible arrangements of 7 children by gender, and the p-value is 1/8, as you say.

But when you calculated the second p-value of 1/32, while you did change the count of arrangements, you failed to recognize that the sample space changed! Now the possibilities are not just all possible arrangements of 7 children (which is what you used), but all possible arrangements of up to 7 children (because the "stop condition" now is not when there are 7 children total, but when there is at least one child of each gender, and that could have happened at a number of children less than 7). So the correct p-value is not 4/2^7, but 4/(2^7 + 2^6 + 2^5 + 2^4 + 2^3 + 2^2) = 4/(2^8 - 2) = 2/127. A Bayesian, who has to calculate the p-value starting from the hypothesis, not the data, would not make that mistake.

And Bayesianism does something else too: it forces you to recognize that the p-value is not actually the answer to the question you were asking! By the p-value criterion, at least with the typical threshold of 0.05, the null hypothesis (that your aunt and uncle are not biased towards having one gender) is rejected. But a Bayesian recognizes that the prior probability of the gender ratio, based on abundant previous evidence, is strongly peaked around 50-50, much more strongly peaked than data with a bias equivalent to a p-value of 2/127 can overcome. So the Bayesian is quite ready to accept that your aunt and uncle had no actual bias towards having boys, they just happened to be one of the statistical outliers that are to be expected given the huge number of humans who have children.


> the sample space changed! Now the possibilities are not just all possible arrangements of 7 children, but all possible arrangements of up to 7 children [...]

> the "stop condition" now is not when there are 7 children total

Your answer makes no sense to me. If you consider the space of possibles combinations that can lead to having a boy and a girl, why do you stop at seven children. Why consider five boys and one girl but reject seven boys and one girl? Both of them are end cases that could be reached.


Yes, I was posting in a rush and was being sloppy. Here's a more detailed calculation.

The process involved is that the couple continues to have children until they have at least one of each gender. If we assume that at each birth there is a probability p of having a boy (as I noted in my response to btilly elsewhere, the Bayesian prior would actually be a distribution for p, not a point value, but I'll ignore that here for simplicity), then the process can be modeled as a branching tree something like this:

Child #1: boy -> p; girl -> 1 - p

Child #2: boy - boy -> p^2; boy - girl -> p(1 - p) : STOP; girl - boy -> (1 - p)p : STOP; girl - girl -> (1 - p)^2

So we have a probability of 2p(1 - p) of stopping at child 2.

Child #3: boy - boy - boy -> p^3; boy - boy - girl -> p^2(1 - p) : STOP; girl - girl - boy -> p(1 - p)^2 : STOP; girl - girl - girl -> (1 - p)^3

So we have a probability of [1 - 2p(1 - p)] [p^2(1 - p) + p(1 - p)^2] of stopping at child 3 (the first factor comes from the probability that we didn't stop at child 2 above).

By a similar process we can carry out the tree for as many children as we want. For the case p = 1/2, which was the case I was considering, all of these expressions for the probability of stopping at child #N (for N > 1) simplify to 1 / 2^(N - 1). So the probability of stopping at or before child #N is the sum of those probabilities from 2 to N; for N = 7 that is 1/2 + 1/4 + 1/8 + 1/16 + 1/32 + 1/64 = 63/64. That is close enough to 1 that I ignored cases with more than 7 children; but for a more exact calculation you could add an extra 1/64 to the denominator used to calculate the likelihood (or p-value) of the specific case that was actually observed, to allow for the cases with more than 7 children.


In Bayes' formula, the absolute probability of the observed outcome does not matter. What matters is the ratio of the observed outcome for a given p to the probability under your prior.

The structure of what might have happened does not affect those ratios. Only what was observed does.


> The structure of what might have happened does not affect those ratios. Only what was observed does.

This is true in the sense that you only compute conditional probabilities for the data that was actually observed, not data that could have been observed but wasn't.

However, there's more to it than that; I'll post upthread in a moment with more detail.


> a Bayesian would also say that the knowledge that they planned to have children until they had both a boy and a girl significantly changes the likelihood ratio (or p-value, if you prefer to use that) associated with the observed data.

Actually, on going back and reviewing Jaynes' Probability Theory (section 6.9.1 in particular), I was wrong here, because in this particular case, the parents' choice of process does not affect the likelihood ratio for the data. So btilly was correct that Bayesian reasoning gives thes same posterior distribution for p (the probability of a given child being a boy) for the two data sets. However, in fact, this is not a problem with Bayesian reasoning: it's a problem with frequentist reasoning! In other words, the frequentist argument that the change in the parents' choice of process does affect the inferences we can validly draw from the data, because the p-value changed, is wrong. The Bayesian viewpoint is the one that gives the correct answer.

Here is an argument for why. The underlying assumption in all of our discussion is that, whatever the value of p is, it is the same for all births: in other words, any given birth is independent of all the others in terms of the chance of the child being a boy. And that assumption, all by itself, is enough to show that the parent's choice of process does not matter as far as inferences from identical outcome data is concerned: it can't matter, because the parents' choice of process does not affect p, i.e., it does not affect the underlying fact that each birth is independent of all the others. And as long as each birth is independent of all the others, then the only relevant properties of the data are the total number of children and the number of boys. Nothing else matters. In particular, the p-value, which requires you to look, not just at the relative proportion of boys and girls in the data, but at how "extreme" that proportion is in the overall sample space (since the p-value is the probability that a result "at least that extreme" could be obtained by chance), does not matter.

Here is another way of looking at it. We are analyzing the same data in two different ways based on two different processes for the parents to decide when they will stop having children. This is equivalent to analyzing two different couples, each of whom uses one of the two processes, and whose data is the same (they both have, in order, six boys and one girl). The claim that the different p-values are relevant is then equivalent to the claim that the data from the two couples is being drawn from different underlying distributions. However, these "distributions" are only meaningful if they correspond to something that is actually relevant to the hypothesis being tested. In this case, that would mean that the couple's intentions regarding how they will decide when to stop having children would have to somehow affect p, since the hypothesis we are testing is a hypothesis about p. But they don't. So the two couples are not part of different distributions in any sense that actually matters for this problem, and hence the different p-values we calculate on the basis of those different distributions should not affect how we weigh the data.

In fact, we can even turn this around. Suppose we decide to test the hypothesis that the parents' choice of process does affect p. How would we do that? Well, we would look at couples who were using different processes, and compare the data they produce, expecting to find variation in the data that correlates to the variation in the process. But in this case, the data is the same for two different choices of process--which means that the data is actually evidence against the hypothesis that the choice of process affects p!

Note that this is not a general claim that other information never matters. It is only a specific claim that, in this particular case, other information doesn't matter. It doesn't matter in this case because of the independence property I described above--the fact that every birth is an independent event with the same value of p, unaffected by the variable that differs between the couples (the choice of process). In hypothetical scenarios where the births were not independent, then other information would be relevant; for example, we might want to consider a hypothesis that the age of the parents affected p. A Bayesian would model this by not treating p as a single variable with some assumed prior distribution, but as a function of other variables, which would need to be present in the data (for example, we would have to record the ages of the parents).

How does all this square with the fact that the total sample space certainly does change if the parents' choice of process changes? In the simple case where the process is "have 7 children", every possible outcome is equally likely, so the probability of any single outcome is just 1 / the total number of outcomes. In the case where the process is "have children until there is at least one of each gender", then the outcomes are not all equally likely; the particular outcome that was observed has the same probability as it would under the first process (so btilly is correct about that), but other outcomes have different probabilities. However, as long as each birth is independent, none of those other probabilities affect the inferences we are justified in drawing from the data; only the probability of the actually observed outcome does. (Strictly speaking, as btilly pointed out downthread, it is not the absolute probability that matters but the likelihood ratio; but the likelihood ratio in this case is just the ratio of P(data|p, prior) to P(data|prior), and P(data|prior) is also the same for both data sets since we are assuming the prior for p is independent of the process used to generate the data sets.)


> a Bayesian looks at this and says that no matter what prior you pick, the knowledge that they planned to have children until they had both a boy and a girl does not affect your posterior conclusion

A Bayesian would say no such thing...

Actually they would if they understood the formula. Bayes' formula has no place to put for things that could have been observed had things turned out differently, but which didn't actually happen. Therefore mighta, woulda, coulda but didn't cannot affect your conclusions. Ever.

However, a Bayesian would also say that the knowledge that they planned to have children until they had both a boy and a girl significantly changes the likelihood ratio (or p-value, if you prefer to use that) associated with the observed data. And one of the advantages of Bayesianism is that it forces you to make that explicit as well.

I am not sure how you think that the calculation should be carried out. But it certainly shouldn't be done the way that you describe.

If your prior was that a fraction p of the children would be boys, the odds of the observed outcome would be p^6 * (1-p). It is that regardless of which version of the experiment you run. The conditional probability the outcome being around p given the data is the odds in your prior of the probability being around p, divided by the a priori odds of the observed outcome, 6 boys and then a girl. The calculation is the same in both versions of the experiment and therefore the conclusion is as well.

And Bayesianism does something else too: it forces you to recognize that the p-value is not actually the answer to the question you were asking! By the p-value criterion, at least with the typical threshold of 0.05, the null hypothesis (that your aunt and uncle are not biased towards having one gender) is rejected. But a Bayesian recognizes that the prior probability of the gender ratio, based on abundant previous evidence, is strongly peaked around 50-50, much more strongly peaked than data with a bias equivalent to a p-value of 2/127 can overcome. So the Bayesian is quite ready to accept that your aunt and uncle had no actual bias towards having boys, they just happened to be one of the statistical outliers that are to be expected given the huge number of humans who have children.

Actually a Bayesian with access to actual population data would be aware, as you aren't, that globally we average 1.07 boys to each girl at birth. Therefore most couples, likely including my aunt and uncle, were probably biased towards having boys.

There is a good deal of coincidence involved in my actually having the setup for a classic criticism of frequentism in a close relative. But if it happened, the odds were in favor of it involving 6 boys and a girl rather than the other way around.


> Bayes' formula has no place to put for things that could have been observed had things turned out differently, but which didn't actually happen.

Sure it does: you have to calculate the probability of your data given the hypothesis. Doing that requires considering all possible outcomes of the hypothesis and their relative likelihood, not just the one you actually observed.

> If your prior was that a fraction p of the children would be boys, the odds of the observed outcome would be p^6 (1-p).*

The prior would not actually be a single value for p; it would be a distribution for p over the range (0, 1). The distribution I described was a narrowly peaked Gaussian around p = 0.5, though, as you point out, that might not be the correct value for the peak (see below). However, for illustration purposes, it is much easier to talk about the (idealized, unrealistic) case where your prior is in fact a single point value for p.

However, in order to calculate the odds of the observed outcome, as I said above, you don't just need to know the prior for p. You need to know the process by which the outcomes are generated, according to the hypothesis. The odds you give assume that that process is "bear seven children, regardless of their gender". But that is not the correct process for the actual decision procedure you describe your aunt and uncle as using. That process won't necessarily result in seven children, and the odds of the actually observed outcome will change accordingly.

> a Bayesian with access to actual population data would be aware, as you aren't, that globally we average 1.07 boys to each girl at birth

Depends on whose data you look at and over what time period. But I agree that the best prior to use in a given case would be whatever distribution you get from the data you already have, and yes, that might not be peaked exactly at 50-50.


"globally we average 1.07 boys to each girl at birth. Therefore most couples, likely including my aunt and uncle, were probably biased towards having boys."

Specifically, Chinese boys.


Specifically, Chinese boys.

You have a point.

US statistics are 1.05 boys to each girl at birth. And that figure has been fairly stable for decades.

Which means that my point remains. Most couples are biased towards boys over girls.


> Most couples are biased towards boys over girls.

Yes, but the Bayesian argument shows that you can't infer that from your one sample. You only know that there is a bias towards boys because you have the global data that allows you to adjust the Bayesian prior to be peaked around the actual observed ratio instead of around 0.5. The Bayesian prior is still a much better prediction for any other case not yet observed than any value different from the prior that you might calculate from the data from just your aunt and uncle.


Let's say you perform a maximum-likelihood estimate, you still have an assumption baked in, that maximizing the likelihood given the data is the right way to make your estimate.

In fact, it's very interesting to reconstruct a Bayesian prior for a maximum likelihood estimate. For example when you calculate probabilities for a binary event, 10 head flips, 8 tail flips. The ML estimate is 8/18 = 4/9. A Beta-Binomial bayesian model leads to a posterior distribution of Beta(a=8, b=10) with a mean of (8+a0)/(10 + 8 + a0 + b0), with a0 and b0 representing the prior distribution Beta(a0, b0). Now you can see that the maximum likelihood estimate is identical in this case to assuming a bayesian Prior of Beta(0, 0).

I am not saying by this that frequentism is Bayesian inference in disguise, rather, you cannot escape the assumptions.

Also, frequentism is not that straightforward, there are many kinds of frequentist estimators and it can be complicated to choose among them.


The ML estimate is a posterior mode, assuming a flat prior. It's not immediately clear that it will always be possible to find a corresponding posterior mean. (From a Bayesian point of view, this is a difference in loss functions as opposed to priors over the parameters. With a posterior mean, you're making the optimal inference assuming a quadratic loss; a posterior mode is appropriate for a 0-or-1 loss.)


That's why your analysis shouldn't report posterior probability but degree of shift in confidence.


> I don't want every rando adding "priors" that "feel" right to their analysis.

Conversely, maybe others see value in a technique that doesn't start from square one every single time.

I mean, knowledge is a thing, yes?


That's not the point. The point is there is no choice between having priors and not. There is only the choice between acknowledging priors versus doublethink, confusion, and deception.

With how fashionable it is to talk about implicit bias, I wonder how those concerns intersect with the people attacking Bayesian approaches here.


See my above comment for an example of a prior that doesn't just "feel" right.


I've seen the question raised whether the "minimalism" (in terms of not owning much) often attributed to Marie Kondo is actually an accurate representation of what she says. The alternative interpretation being something more like "mindful ownership".

I'm in that second camp, slightly confused by people saying things like "Marie Kondo thinks I shouldn't own more than 20 books" or whatever, because that wasn't what I understood. The point is to think about whether that number of books is an effective use of your living space - and the answer can be yes.

So yeah, an online store seems a little odd, but by this point my default position on anything M-K related is "take a second and make sure this isn't misrepresenting her views". Maybe a little shop full of neat things that Marie Kondo likes is... fine? ¯\_(ツ)_/¯


I think where the confusion comes in is that, at least in the English translation of the book, there is a lot of mixed messaging. The general narrative arc of the chapter on books was, "Sure, if you really love books, I guess you can own a lot of them, but let me now spend 5 pages browbeating you with exposition on how you can't really love more than a handful of books at a time, and talk at length about how how my life was greatly improved by throwing my favorite book, the one book that has brought me the most happiness in life, into the trash."

That said, I'm pretty sure there's nowhere in the book where it said that a 4,096Hz tuning fork - that's the perfect frequency for sparking joy - can't possibly spark joy.

On the other hand, that laptop computer brush. . . I imagine the woman who wrote The Life-Changing Magic of Tidying Up, the book that argues forcefully that the only good container is either made of cheap clear plastic or an old shoebox, would have advocated for dusting your laptop off with a cleaning rag.

On the other other hand, the woman who wrote that book wasn't a world-famous figure with her own popular series on Netflix.


There is also the way that, in a capitalist system, every message eventually gets swallowed up and transformed into a way to sell products. It's just the nature of the beast. The hippies started out preaching the importance of love over material wealth, and their message ended up getting twisted into a sales pitch for Coca-Cola (https://www.youtube.com/watch?v=1VM2eLhvsSM).

So in the end, it doesn't really matter much what Marie Kondo's message is; once it became popular the system was inevitably going to fold, spindle and mutilate it until it could be used to sell products, because that's what the system does. It deflects critique by absorbing and redirecting it, and it is really damn good at doing so.


Exactly so. And by the same token, every sensory impulse capable of grabbing human attention will eventually be filled to the brim with ads until we can't experience anything without expecting, nay wanting, accompanying banners, jingles, (and no doubt soon; smells) that entice us to buy.

Homo Consumens: https://www.philosophicalsociety.com/Archives/Homo%20Consume...


This was perfectly said and articulated, thanks


The key is to not make it popular. Have a barrier to entry.


Capitalism vores everything.


On the other hand, a $14 empty bottle for hand soap, or $180 for a cheese knife... I mean, come on.

There is mindfulness about what you own, and then there is selling overpriced junk using your brand just like everyone else. Sure, you can be mindful and enjoy your MK $220 fruit bowl, but really what you are buying is the brand, not the bowl.

I think there is an implicit "don't buy things just because you want other people to see you bought it", which is contradictory with the idea of selling overpriced knickknacks that only serve to show other people that you bought into some kitchy fad.


I can understand the soap bottle¹. A dedicated reusable glass container instead of a bunch of single-use plastic ones is less wasteful, and looks better, in my opinion. $14 ain't bad for that, price-wise, assuming they're good quality (which is a big "if", in fairness, but still).

$180 for a cheese knife, or $75 for a tuning fork and a crystal the sum of which costs half that on Amazon (let alone Alibaba), is on the other hand quite absurd.

----

¹: Disclaimer: my employer sells (among many other things) glass bottles pretty similar to the ones on shop.konmari.com. something something these are my opinions something something not representative of my employer something something


> or $180 for a cheese knife...

If it costs more, you'll, um, buy fewer of them?


In fairness, her answer to “ it what if I need it later?” is “then you can just buy it again!”

Her shtick has always been “get rid of stuff you don’t need” layered on top of rabid consumerism. This doesn’t seem the slightest bit out of character.


She isn't telling you to buy it brand new from retail. That's the absolute worst way to buy products. Buy it again means turn cash into utility, and if you buy used and sell once you are done with that utility, you can end up at zero net loss.

I moved into an apartment where I had to cut my own grass. I bought a mower for $50 and cut grass all summer. The next spring, I moved to a different apartment without a lawn and sold that mower for $50. If I ever need to cut grass again, I'll be back in the $50 mower market.

Net cost is zero to me and I have only just enough utility as I ever need, which is exactly what kondo envisions. No rabid corporate machine has been fed with my transient lawn care needs, just more circulation around the hyperlocal economy that is removed from globalism.


What she knows is that you often don't need it later.


I agree. It seems perfectly in line to get rid of all the things you actually don't like (but failed to notice in daily life) and replace them with things that make you happy.


Do the items in this store come with a guarantee they'll make you happy?

If they don't, how can anyone be sure they won't end up in the "Random crap I bought for no good reason and never really wanted or needed" pile?


They don't "make you happy", they "spark joy" :P

In all serioursness, after having "studied" the Minimalists, Marie Kondo, and having read plenty of Stoics' works, they all (more or less) point to the same direction (in my interpretation): lead the life YOU want. Don't get carried away in owning what others mandate, but what you need, don't do what others want you do but only what fulfills you, etc.

I tell my friends that I avoid things (items) that change my state. I want ME to change my state. I want people to change my state (to the positive preferably). A laptop won't make me happy. Skyping with friends via the laptop will.

A pile of books is only useful as one uses it. Having a bookcase filled with books I will never read again won't make me happy. Giving them away and keeping a one-in-one-out system will. (at least for me). Piles can be as good as non-piles can be. It's all with what we do with them :)


For the people that derive joy from throwing out junk...


I get what you're saying, but it also seems like a bit of a stretch to describe her "philosophy" as nothing more than "own anything that you like."

It would be odd if a popular advocate of healthy dieting opened a store selling a bunch of addictive junk food, and people jumped in and claimed that the person's philosophy is really just "mindful eating" and that if you think about what diet will make you happy, the answer might be a bunch of addictive junk food, and maybe that's fine!


> it also seems like a bit of a stretch to describe her "philosophy" as nothing more than "own anything that you like."

That's not really what he said. Mindful ownership isn't "anything you like".


I've decided to limit myself to one bookcase full of books, for similar reasons. Similarly, I'm trying to get rid of any technology that I can readily go buy another one at a reasonably cost anywhere.


A room full of books sparks joy in me.


I've always thought about whether I really need any given thing every time I move.


Kondo summarized: "If it doesn't bring you joy, throw it out."


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

Search: