[HN Gopher] Statistical Rethinking (2022 Edition) ___________________________________________________________________ Statistical Rethinking (2022 Edition) Author : eternalban Score : 323 points Date : 2022-01-16 14:50 UTC (8 hours ago) (HTM) web link (github.com) (TXT) w3m dump (github.com) | xayfs wrote: | elcapitan wrote: | Does the course require prior statistical knowledge? Couldn't | quite figure that out. It looks interesting, and there are python | versions of the examples as well.. | agucova wrote: | You'll probably need some basic notions of statistical | distributions and data analysis; I recommend reading the first | chapter of the book or the first lecture and seeing whether | you're missing anything important. | jonnycomputer wrote: | I think you'll be fine, actually. I've read through the first | edition, and it's kept pretty intuitive. | qorrect wrote: | I got through it without any priors :). | elcapitan wrote: | Thanks! :) | reactspa wrote: | There's so much great content on the internet that's not easily | discoverable. This is one. | | If you have discovered a great resource for intuitively learning | about fat-tailed-distributions related mathematics, please share. | I have fallen into the Taleb rabbit-hole and would really like to | gain an * _intuitive*_ understanding of what he 's talking about | when he mentions topics such as gamma distributions, lognormal | distributions, loglikelihood. | laGrenouille wrote: | > The unfortunate truth about data is that nothing much can be | done with it | | This is a fairly strong statement that goes against a lot of | other work in data science and information visualization (John | Tukey, Edward Tufte, Jacques Bertin, Hadley Wickham, ...). For | example, see [0] and [1]. | | [0] https://en.wikipedia.org/wiki/Exploratory_data_analysis [1] | https://courses.csail.mit.edu/18.337/2015/docs/50YearsDataSc... | nightski wrote: | You are leaving out a very important part of the sentence - | "until we say what caused it". If you listen to the first few | lectures you'll understand exactly what he intends with this | sentence. | laGrenouille wrote: | Thanks, though I actually meant to copy the entire thing (my | fault). | | My point was that a lot of people working in data analysis | would (strongly) disagree with the idea that we need to model | the data in order to do anything with it. Visualisations and | tabulations can tell a lot without any mathematical | formalism. | chiefalchemist wrote: | To your point...Data has context. It has a source. It likely | has flaws and/or (so to speak) bias. To get anything of it | It's essential to understand what went into it. Else you'll | deceive yourself or your stakeholders and bad decisions will | be made. | hinkley wrote: | This cleaves very close to an aphorism I stole mercilessly | many years ago: charts are for asking questions, not | answering them. | | "What caused it" is the answer, and a graph can reveal just | as easily as it can conceal the cause. Lies, damn lies, and | statistics. | bigbillheck wrote: | > The unfortunate truth about data is that nothing much can be | done with it until we say what caused it | | Nonparametric methods say 'hi'. | agucova wrote: | This is taking the quote completely out of context, it's not | the data itself that conveys useful information, it's the data | combined with a causal model! | akdor1154 wrote: | I wanna buy the hardcopy textbook but still have access to an | epub version - do any retailers allow this? Linked publisher site | doesn't seem to. | dang wrote: | Past related threads: | | _Statistical Rethinking [video]_ - | https://news.ycombinator.com/item?id=29780550 - Jan 2022 (10 | comments) | | _Statistical Rethinking: A Bayesian Course Using R and Stan_ - | https://news.ycombinator.com/item?id=20102950 - June 2019 (14 | comments) | canjobear wrote: | I've been reading polemics and tutorials for at least 12 years | now arguing for Bayesian methods over Frequentist methods. They | all seem persuasive, and everyone seems to be convinced that | Bayesianism is the future, and Frequentism was a mistake, and the | change to a glorious future where Bayesian methods are the | standard way to do stats is just round the corner. It hasn't | happened. | | Meanwhile I've never read a real argument _for_ Frequentism and I | don 't know where I'd find one, short of going back to Fisher who | is not well known for clear writing. | | What is going on? Is the future of Bayesian statistics just more | and more decades of books and articles and code notebooks and | great presentations showing how great Bayesianism is? Is it just | institutional inertia preventing Bayesian stats from becoming | standard, or does Frequentism have a secret strength that keeps | it hegemonic? | agucova wrote: | I guess it really depends on your discipline, but Bayesian | methods have become more and more popular in a lot of academic | communities, being published alongside papers using frequentist | methods, so I wouldn't say it's hegemonic anymore. | lkozma wrote: | For those coming from a CS background a possible (crude) | intuition sometimes given is that | | frequentist :: Bayesian ~ worst-case analysis :: average-case | analysis | | There are a good reasons why we don't usually do average-case | analysis of algorithms, chief among them that we have no idea | how inputs are distributed (another reason is computational | difficulty). Worst-case bounds are pessimistic, but they hold. | civilized wrote: | The biggest problem with Bayesian statistics in practice is the | frequent reliance on relatively slow, unreliable methods such | as MCMC. | | The Bayesian methodology community loves to advocate for | packages like Stan, claiming that they make Bayesian stats | easy. This is true... relative to Bayesian stats without Stan. | But these packages are often much, much harder to get useful | results from than the methods of classical statistics. You have | to worry about all sorts of technical issues specific to these | methodologies, because these issues don't have general | technical solutions. Knowing when you even _have_ a solution is | often a huge pain with sampling techniques like MCMC. | | So you have to become an expert in this zoo of Bayesian | technicalities above and beyond whatever actual problem you are | trying to solve. And in the end, the results usually carry no | more insight or reliability than you would have gotten from a | simpler method. | | I recommend learning about Bayesianism at a philosophical | level. Every scientist should know how to evaluate their | results from a Bayesian perspective, at least qualitatively. | But don't get too into Bayesian methodology beyond simple | methods like conjugate prior updating... unless you are lucky | enough to have a problem that is amenable to a reliable, | practical Bayesian solution. | [deleted] | 13415 wrote: | I don't know much about statistical uses of Bayesianism but can | say something opinionated about the underlying philosophy. | | From a philosophical point of view, Bayesianism is fairly weak | and lacks argumentative support. The underlying idea of | probabilism - that degrees of belief have to be represented by | probability measures - is in my opinion wrong for many reasons. | Basically the only well-developed arguments for this view are | Dutch book arguments, which make a number of questionable | assumptions. Besides, priors are also often not known. As far | as I can see, subjective utilities can only be considered | rational as long as they match objective probabilities, i.e., | if the agent responds in epistemically truth-conducive ways | (using successful learning methods) to evidence and does not | have strongly misleading and skewed priors. | | I also reject the use of simple probability representations in | decision theory, first because they do not adequately represent | uncertainty, second because they make too strong rationality | assumptions in the multiattribute case, and third because there | are good reasons why evaluations of outcomes and states of | affairs ought to be based on lexicographic value comparisons, | not just on a simple expected utility principle. Generally | speaking, Bayesians in this area tend to choose too simple | epistemic representations and too simple value representations. | The worst kind of Bayesians in philosophy are those who present | Bayesian updating as if it was the only right way to respond to | evidence. This is wrong on many levels, most notably by | misunderstanding how theory discovery can and should work. | | In contrast, frequentism is way more cautious and does not make | weird normative-psychological claims about how our beliefs | ought to be structured. It represents an overall more skeptical | approach, especially when hypothesis testing is combined with | causal models. A propensity analysis of probability may also | sometimes make sense, but this depends on analytical models and | these are not always available. | | There are good uses of Bayesian statistics that do not hinge on | subjective probabilities and any of the above philosophical | views about them, and for which the priors are well motivated. | But the philosophical underpinnings are weak, and whenever I | read an application of Bayesian statistics I first wonder | whether the authors haven't just used this method to do some | trickery that might be problematic at a closer look. | | I'd be happy if everyone would just use classical hypothesis | testing in a pre-registered study with a p value below 1%. | spekcular wrote: | Regarding "and third because there are good reasons why | evaluations of outcomes and states of affairs ought to be | based on lexicographic value comparisons, not just on a | simple expected utility principle": do you have any suggested | references that describe this in more detail? | | Same question for "This is wrong on many levels, most notably | by misunderstanding how theory discovery can and should | work." | | Also, do you have any suggestions for statistics books that | you _do_ like? Especially those with an applied bent (i.e. | actually working with data, not philosophical discussions). | kgwgk wrote: | > The underlying idea of probabilism - that degrees of belief | have to be represented by probability measures - is in my | opinion wrong for many reasons. Basically the only well- | developed arguments for this view are Dutch book arguments, | which make a number of questionable assumptions. | | Why don't you consider Cox's theorem - and related arguments | - well-developed? | | https://en.wikipedia.org/wiki/Cox%27s_theorem | spekcular wrote: | Dempster-Schafer theory is the obvious counterexample to | "degrees of belief have to be represented by probability | measures." | | https://en.wikipedia.org/wiki/Dempster%E2%80%93Shafer_theor | y | kgwgk wrote: | Does is somehow imply that the Dutch book argument is | better developed than Cox's argument? | spekcular wrote: | You asked, "Why don't you consider Cox's theorem - and | related arguments - well-developed?" I consider Cox's | argument not well-developed because D-S theory shows the | postulates miss useful and important alternatives. So it | fails as an argument for a particular interpretation of | probability. | kgwgk wrote: | I quoted 13415 saying that the only well-developed | arguments were [...] and asked him why didn't he consider | [...] well-developed - compared to the former. I | apologize if the scope of the question was not clear. | 13415 wrote: | That's an excellent question. The answer is that I don't | really count such kind of theorems as positive arguments. | They are more like indicators that carve out the space of | possible representations of rational belief and basically | amount to reverse-engineering when they are used as | justifications. Savage does something similar in his | seminal book, he stipulates some postulates for subjective | plausibility that happen to amount to full probability (in | a multicriteria decision-making setting). He motivates | these postulates, including fairly technical ones, by | finding intuitively compelling examples. But you can also | find intuitively compelling counter-examples. | | To mention some alternative epistemic representations that | could or have also been axiomatized: Dempster-Shafer | theory, possibility theory by Dubois/Prade, Halpern's | generalizations (plausibility theory), Haas-Spohn ranking | theory, qualitative representations by authors like | Bouyssou, Pirlot, Vincke, convex sets of probability | measures, Josang's "subjective logic", etc. Some of them | are based on probability measures, others are not. (You can | find various formal connections between them, of course.) | | The problem is that presenting a set of axioms/postulates | and claiming they are "rational" and others aren't is | really just a stipulation. Moreover, in my opinion a good | representation of epistemic states should at least account | for uncertainty (as opposed to risk), because uncertainty | is omnipresent. That can be done with probability measures, | too, of course, but then the representation becomes more | complicated. There is plenty of leeway for alternative | accounts and a more nuanced discussion. | kgwgk wrote: | Thanks. I found interesting that you like the Dutch book | arguments more than the axiomatic ones. | | > Moreover, in my opinion a good representation of | epistemic states should at least account for uncertainty | (as opposed to risk), because uncertainty is omnipresent. | | Maybe I'm misunderstading that remark because the whole | point of Bayesian epistemology is to address uncertainty | - including (but definitely not limited to) risk. See for | example Lindley's book: Understanding Uncertainty. | | Now, we could argue that this theory doesn't help when | the uncertainty is so deep that it cannot be modelled or | measured in any meaningful way. | | But it's useful in many settings which are not about | risk. One couple of examples from the first chapter of | the aforementioned book: "the defendant is guilty", "the | proportion of HIV [or Covid!] cases in the population | currently exceeds 10%". | 13415 wrote: | Dutch book arguments are at least intended to provide a | sufficient condition and are tied to interpretations of | ideal human behavior, although they also make fairly | strong assumptions about human rationality. The | axiomatizations do not have accompanying uniqueness | theorems. The situation is parallel in logic. Every good | logic is axiomatized and has a proof theory, thus you | cannot take the existence of a consistent axiom system as | an argument for the claim that this is the one and only | right logic (e.g. to resolve a dispute between an | intuitionist and a classical logician). | | The point about uncertainty was really just concerning | the philosophical thesis that graded rational belief _is_ | based on a probability measure. A simple probability | measure is not good enough as a general epistemic | representation because it cannot represent lack of belief | - you always have P(-A)=1-P(A). But of course there are | many ways of using probabilities to represent lack of | knowledge, plausibility theory and Dempster-Shafer theory | are both based on that, and so are interval | representations or Josang 's account. | | I'll check out Lindley's book, it sounds interesting. | kgwgk wrote: | > "degrees of belief have to be represented by | probability measures", "the philosophical thesis that | graded rational belief is based on a probability measure" | | Of course it all depends on how we want to define things, | we agree on that. There is some "justification" for | Bayesian inference if we accept some constraints. And | even if there are alternatives - or extensions - to | Bayesian epistemology I don't think they have produced a | better inference method (or any, really). | agucova wrote: | I'm following the course using Julia/Turing.jl and it's simply | awesome. | | Richard McElreath clearly has a talent for teaching, and both the | lectures and his book also give a very insightful discussion on | the philosophy of science and common pitfalls of common | statistical methods. | | Last semester I took my first classical Probability and | Statistics course at my uni, and this course has been positively | refreshing in comparison. | rabaath wrote: | This book is amazing. In my opinion the best book to get started | with advanced statistics (all statistics, not just Bayesian | statistics). | huijzer wrote: | One problem though. If you start with McElreath, you will | likely find all books which require you to wrangle your brain | into sided p-values and confidence intervals stupid | ivan_ah wrote: | Here is a direct link to the playlist: | https://www.youtube.com/playlist?list=PLDcUM9US4XdMROZ57-OIR... | Prof. McElreath has been adding two new videos every week. | | Also, for anyone who prefers to use the pythons for the coding, I | recommend the PyMC3 notebooks https://github.com/pymc- | devs/resources/tree/master/Rethinkin... There is also a | discussion forum related to this repo here | https://gitter.im/Statistical-Rethinking-with-Python-and-PyM... | canyon289 wrote: | Im one of the Core devs for Arviz and PyMC! Glad you found | those resources useful. If any has any questions feel free to | ask them in gitter and we'd be happy to help | throwoutway wrote: | Will there be other course schedules? These dates don't work for | me unfortunately | cinntaile wrote: | Unless you're a student there you won't be able to attend the | classes and get a grade anyway. You just watch the Youtube | video's, he makes new ones each year. | rossdavidh wrote: | Also, having self-taught from the previous edition of his | excellent book, I can say that it is very useful even if you | aren't able to attend his class. | canyon289 wrote: | Self plug: After reading this book if you're looking to continue | I recently published a book in the same series with the same | publisher. | | The book is available for open access, though I appreciate folks | buying a copy too! https://bayesiancomputationbook.com | | https://www.routledge.com/Bayesian-Modeling-and-Computation-... | kfor wrote: | Awesome book, Ravin! I'm waiting for my physical copy to arrive | (should be here tomorrow!) before really diving in, but what | I've skimmed in the digital copy so far is great. | | Btw I've been using PyMC2 since 2010 and contracted a bit with | PyMC Labs, so I'm surprised we've never bumped into each other! | sean_the_geek wrote: | Thank you! | spekcular wrote: | Looks fun! Thanks for sharing. It seems like it covers | complementary topics in a very concrete and clear way. | canyon289 wrote: | Thanks for checking it out and the feedback. I appreciate it! | spekcular wrote: | This is a great book. | | However, I really hate the "Golem of Prague" introduction. It | presents an oversimplified caricature of modern frequentist | methods, and is therefore rather misleading about the benefits of | Bayesian modeling. Moreover, most practicing statisticians don't | really view these points of view as incompatible. Compare to the | treatment in Gelman et al.'s Bayesian Data Analysis. There are | p-values all over the place. | | Most importantly, this critique fails on basic philosophical | grounds. Suppose you give me a statistical problem, and I produce | a Bayesian solution that, upon further examination with | simulations, gives the wrong answer 90% of time on identical | problems. If you think there's something wrong with that, then | congratulations, you're a "frequentist," or at least believe | there's some important insight about statistics that's not | captured by doing everything in a rote Bayesian way. (And if you | don't think there's something wrong with that, I'd love to hear | why.) | | Also, this isn't a purely academic thought experiment. There are | real examples of Bayesian estimators, for concrete and practical | problems such as clustering, that give the wrong estimates for | parameters with high probability (even as the sample size grows | arbitrarily large). | kkoncevicius wrote: | > If you think there's something wrong with that, then | congratulations, you're a "frequentist". | | And more than that - if you use bootstrap, or do cross- | validation, you are being a frequentist. | nightski wrote: | Hmm. He was comparing the Bayesian models to golems as well, | not just frequentist. It was an analogy to all statistical | models. | | Second in the lectures he said that he uses frequentist | techniques all the time and that it's often worth looking at it | from each perspective. | | I interpreted it as his problem is not with the methods | themselves, but with how they are commonly used in science. To | me this made a lot of sense. | spekcular wrote: | I think I'm misremembering. I read through some of the | introductory material in the second edition of his book and | found it less critical than I recalled. | | But in some places, it definitely comes across as hostile | (e.g. footnote 107). | | Also, the sentence "Bayesian probability is a very general | approach to probability, and it includes as a special case | another important approach, the frequentist approach" is | pretty funny. I know the exact technical result he's | referring to, but it's clearly wrong to gloss it like that. | | He does mention consistency once, page 221, but | (unconvincingly) handwaves away concerns about it. (Large N | regimes exist that aren't N=infinity...) | nightski wrote: | Honestly I think it is a little hostile. Not towards | frequentist directly, but towards the mis-use of | frequentist methods in science. He works in ecology and I | think he comes across a bunch of crap all the time. He | talks at length about the statistical crisis in science and | I can't really blame him. | | But I could see how someone might take this as an attack on | the methods themselves. | kmonad wrote: | I agree. The golem is presented as an analogue to any | statistical inference: powerful but ultimately dumb, in | the sense that it won't think for you. That's in my | opinion the major theme of the book---you have to think | and not rely on algorithms/tools/machines...or golems to | do that for you. | rwilson4 wrote: | Gill's book, Bayesian Methods, is even more dismissive, and | even hostile towards Frequentist methods. Whereas I've never | seen a frequentist book dismissive of Bayes methods. | (Counterexamples welcome!) | | It boils down to whether you give precedence to the likelihood | principle or the strong repeated sampling principle (Bayes | prefers the likelihood principle and Frequentist prefers | repeated sampling). See Cox and Hinkley's Theoretical | Statistics for a full discussion, but basically the likelihood | principle states that all conclusions should be based | exclusively on the likelihood function; in layman's terms, on | the data themselves. This specifically omits what a frequentist | would call important contextual metadata, like whether the | sample size is random, why the sample size is what it is, etc. | | The strong repeated sampling principle states that the goodness | of a statistical procedure should be evaluated based on | performance under hypothetical repetitions. Bayesians often | dismiss this as: "what are these hypothetical repetitions? Why | should I care?" | | Well, it depends. If you're predicting the results of an | election, it's a special 1 time event. It isn't obvious what a | repetition would mean. If you're analyzing an A/B test it's | easy to imagine running another test, some other team running | the same test, etc. Frequentist statistics values consistency | here, more so than Bayesian methods do. | | That's not to come out in support of one vs the other. You need | to understand the strengths and drawbacks of each and decide | situationally which to use. (Disclaimer: I consider myself a | Frequentist but sometimes use Bayesian methods.) | it_does_follow wrote: | > Whereas I've never seen a frequentist book dismissive of | Bayes methods | | Nearly every Frequentist book I have mentioning Bayesian | method attempts to write them off pretty quickly as | "subjective" (Wasserman, comes immediately to mind but there | are others), which is falsely implying that some how | Frequentist methods are some how more "objective" (ignoring | the parts of your modeling that are subject does not somehow | make you more object). The very phrase of the largely | frequentist method "Empirical Bayes" is a great example of | this. It's an ad hoc method that somehow implies that Bayes | is not Empirical (Gelman et al specifically call this out). | | Until very recently Frequentist methods have near universally | been the entrenched orthodoxy in most fields. Most Bayesians | have spend a fair bit of their life having their methods | rejected by people who don't really understand the foundation | of their testing tools, but more so think their testing tools | come from divine inspiration and ought not to be questioned. | Bayesian statistics generally does not rely on any ad hoc | testing mechanism, and can all be derived pretty easily from | first principles. It's funny you mentioned A/B tests as a | good frequentist example, when most marketers absolutely | prefer their results interpreted as the "probability that A > | B", which is the more Bayesian interpretation. Likewise the | extension for A/B to multi-armed bandit trivially falls out | of the Bayesian approach to the problem. | | Your "likelihood" principle discussion is also a bit | confusing here for me. In my experience Fisherian schools | tend to be the highest champions of likelihood methods. | Bayesians wouldn't need tools like Stan and PyMC if they were | exclusively about likelihood since all likelihood methods can | be performed strictly with derivatives. | periheli0n wrote: | This sounds to me very much like a political debate between | people arguing for the best method, rather than focusing on | the results that you can get with either method. | | As long as this debate is still fuelled by emotional and | political discourse, nothing useful will come out of it. | | What is really needed is an assessment which method is best | suited for which cases. | | The practitioner wants to know "which approach should I | use", not "which camp is the person I'm listening to in?" | spekcular wrote: | "Whereas I've never seen a frequentist book dismissive of | Bayes methods. (Counterexamples welcome!)" | | Indeed! There's a lot of Bayesian propaganda floating around | these days. While I enjoy it, I would also love to see some | frequentist propaganda (ideally with substantive educational | content...). | kkoncevicius wrote: | A book by Deborah Mayo "Statistical Inference as Severe | Testing" might fit. | spekcular wrote: | I've read it. Unfortunately, I thought it was terribly | written. Also, it's a philosophy book, not a guide for | practitioners. | kkoncevicius wrote: | In my opinion books for practitioners is not the place | for such discussions. Deborah's book might be poorly | written, but if we want to go where the foundations of | disagreements are we have to reach philosophy. Bayessian | advocates are also often philosophers, like i.e. Jacob | Feldman. | | From theoretical statisticians Larry Wasserman is more on | the frequentist side. See for example his response on | Deborah's blog [1]. But he doesn't advocate for it in his | books. So yeah, besides Deborah, I am not aware of any | other frequentist "propagandist". | | [1] | https://errorstatistics.com/2013/12/27/deconstructing- | larry-... | huijzer wrote: | > Indeed! There's a lot of Bayesian propaganda floating | around these days. While I enjoy it, I would also love to | see some frequentist propaganda | | I think that frequentist statistics doesn't need marketing. | It's the default way to do statistics for everyone and, | frankly, Bayesian software is still quite far away from | frequentist software in terms of speed and ease of use. | Speed will be fixed by Moore's law and better software and | easy of use will also be fixed by better software at some | point. McElreath and Gelman and many others do a great job | in getting more people into Bayesian statistics which will | likely result in better software in the long run | siddboots wrote: | All of Statistics by Larry Wasserman is a great | introductory book from the frequentist tradition that | includes some sections on Bayesian methods. It's definitely | not frequentist propaganda - more like a sober look at the | pros and cons of the Bayesian point of view. | CrazyStat wrote: | My first year of grad school I ordered a textbook but | what I got was actually All of Statistics with the wrong | cover bound on. | | I skimmed through a couple chapters before returning it | for a refund. I sometimes regret not keeping it as a | curio, but I was a poor grad student at the time and it | was an expensive book. | harry8 wrote: | https://archive.org/details/springer_10.1007-978-0-387-21 | 736... | | Statistics & machine learning book authors seem to be | really good at providing a free, electronic copy. | qorrect wrote: | > I consider myself a Frequentist | | Grab the pitchforks! | valenterry wrote: | Thank you! That's the kind of comments why I come here. | 41b696ef1113 wrote: | >Whereas I've never seen a frequentist book dismissive of | Bayes methods. | | I think it more has to do with the long history of anti- | Bayesianism championed by Fischer. He was a powerhouse who | did a lot to undermine its use. The Theory that Would Not Die | went into some of these details. | [deleted] | kgwgk wrote: | Suppose you give me a particle physics problem, and I produce a | quantum mechanics solution that, upon further examination, is | wrong. | | If you think there's something wrong with that, then | congratulations, you're a "quantum negationist," or at least | believe there's some important insight about physics that's not | captured by doing everything in a rote quantum way. (The | important insight being that GIGO.) | spekcular wrote: | The issue isn't that Bayesian methods used incorrectly can | have bad frequentist properties. It's that, according to many | flavors of Bayesianism, having bad frequentist properties | _isn 't a valid line of critique_. | | You may not believe in the particular stances I'm calling | out, but if so, we don't disagree. | kgwgk wrote: | Maybe we don't disagree. You wrote: | | > a Bayesian solution that, upon further examination with | simulations, gives the wrong answer 90% of time on | identical problems | | If "with simulations" means either | | "with simulations using a probability distribution | different from the prior used in the Bayesian analysis" | | or | | "with simulations using a model different from the one used | in the Bayesian analysis" | | are we expected to conclude that there is something wrong | with the Bayesian way? | spekcular wrote: | I mean "with simulations using a probability distribution | [for the true parameter] different from the prior used in | the Bayesian analysis." (The issue of model error is a | separate question.) | | Yes, in this case would should conclude there is | something wrong with the Bayesian way. If you hand me a | statistical method to e.g. estimate some parameter that | frequently returns answers that are far from the truth, | that is a problem. One cannot assume the prior exactly | describes reality (or there would be no point in doing | inference, because the prior already gives you the | truth). | kgwgk wrote: | At least a Bayesian posterior tries to describe reality. | In a way which is consistent with the prior and the data. | But again, GIGO. | | On the other hand, Frequentist methods do not claim | anything concrete about reality. Only about long-run | frequencies in hypothetical replications. | | You may think that makes them better, it's your choice. | agucova wrote: | I think the classes opt for starting with a simple mental model | students can adopt, which is gradually replaced with a more | robust and nuanced mental model. | | In this case he wasn't talking just about frequentist methods | tho, it's also talking about doing statistics without first | doing science (and formulating a causal model). | | I would be wary of jumping to conclusions from that | introduction alone if you haven't seen the rest of the course | or the book. | funklute wrote: | > There are real examples of Bayesian estimators, for concrete | and practical problems such as clustering, that give the wrong | estimates for parameters with high probability (even as the | sample size grows arbitrarily large). | | Could you give some specific examples, and/or references? This | is new to me, and I would like to read deeper into it. | medstrom wrote: | Uh, dude. If you read the book, you'd see the Golem of Prague | isn't a parable about frequentist models specifically, it's | about all models, period. He calls his Bayesian models golems | all the time. | jdreaver wrote: | I've read this book and taken this course twice, and it is easily | one of the best learning experiences I've ever had. Statistics is | a fascinating subject and Richard helps bring it alive. I had | studied lots of classical statistics texts, but didn't quite | "get" Bayesian statistics until I took Richard's course. | | Even if you aren't a data scientist or a statistician (I'm an | infrastructure/software engineer, but I've dabbled as the "data | person" in different startups), learning basic statistics will | open your eyes to how easy it is to misinterpret data. My | favorite part of this course, besides helping me understand | Bayesian statistics, is the few chapters on causal relationships. | I use that knowledge quite often at work and in my day-to-day | life when reading the news; instead of crying "correlation is not | causation!", you are armed with a more nuanced understanding of | confounding variables, post-treatment bias, collider bias, etc. | | Lastly, don't be turned off by the use of R in this book. R is | the programming language of statistics, and is quite easy to | learn if you are already a software engineer and know a scripting | language. It really is a powerful domain specific language for | statistics, if not for the language then for all of the | statisticians that have contributed to it. | agucova wrote: | Even if you don't like R, your can do the entire course with | Julia/Turing, Julia/Stan or Python, the course github's page | has a list of "code translations" for all the examples. | fault1 wrote: | There is also other translations, for example, in | pytorch/pyro: https://fehiepsi.github.io/rethinking-pyro/ | | I would say statistical rethinking is a great way to compare | and contrast different ppl impls and languages, I've been | using it with Turing, which is pretty great. | jonnycomputer wrote: | I frequently prefer R to python/pandas/numpy for data analysis | --even if most of my other programming is in python. | elcapitan wrote: | What's the advantage, if you already know Python? (genuine | interest) | Bootvis wrote: | For me, I use R data.table a lot and I see as the main | advantages are performance and the terse syntax. The terse | syntax does come with a steep learning curve though. | VeninVidiaVicii wrote: | I totally agree. I often find myself wanting data.table | as a standalone database platform or ORM-type interface | for non-statistical programming too. | boppo1 wrote: | What is terse syntax? I can parse lisp and C, how would | this be different and challenging? | bckygldstn wrote: | The syntax isn't self-describing and uses lots of | abbreviations; it relies on some R magic that I found | confusing when learning (unquoted column names and | special builtin variables); and data.table is just a | different approach to SQL and other dataframe libraries. | | Here's an example from the docs | flights[carrier == "AA", lapply(.SD, mean), | by = .(origin, dest, month), .SDcols = | c("arr_delay", "dep_delay")] | | that's clearly less clear than SQL SELECT | origin, dest, month, MEAN(arr_delay), | MEAN(dep_delay) FROM flights WHERE carrier == | "AA" GROUP BY arr_delay, dep_delay | | or pandas flights[filghts.carrier == | 'AA'].groupby(['arr_delay', 'dep_delay']).mean() | | But once you get used to it data.table makes a lot of | sense: every operation can be broken down to | filtering/selecting, aggregating/transforming, and | grouping/windowing. Taking the first two rows per group | is a mess in SQL or pandas, but is super simple in | data.table flights[, head(.SD, 2), by = | month] | | That data.table has significantly better performance than | any other dataframe library in any language is a nice | bonus! | kgwgk wrote: | You mean something like SELECT | origin, dest, month, AVG(arr_delay), AVG(dep_delay) | FROM flights WHERE carrier == 'AA' GROUP | BY origin, dest, month | | and flights[flights.carrier == | 'AA'].groupby(['origin', 'dest', 'month'])[['arr_delay', | 'dep_delay']].mean() | bckygldstn wrote: | Yep thanks, you can tell I use a "guess and check" | approach to writing sql and pandas... | hervature wrote: | Taking the first two rows is a mess in pandas? | | flights.groupby("month").head(2) | | Not only is does this have all the same keywords, but it | is organized in a much clearer way to newcomers and | labels things to look up in the API. Whereas your R code | has a leading comma, .SD, and a mix of quotes and non- | quotes for references to columns. You even admit the last | was confusing to learn. This can all be crammed in your | head, but not what I would call thoughtfully designed. | [deleted] | jarenmf wrote: | Indeed, data.table is just awesome for productivity. When | you're manipulating data for exploration you want the | least number of keystrokes to bring an idea to life and | data.table gives you that. | jonnycomputer wrote: | I don't want to say "advantage", so much as preference. But | a few things come to mind. | | - Lots of high quality statistical libraries, for one | thing. | | - RStudio's RMarkown is great; I prefer it to Jupyter | Notebook. | | - I personally found the syntax more intuitive, easier to | pick up. I don't usually find myself confused about the | structure of the objects I'm looking at. For whatever | reason, the "syntax" of pandas doesn't square well (in my | opinion) with python generally. I certainly _want_ to just | use python. But, shrug. | | - The tidyverse package, especially the pipe operator %>%, | which afaik doesn't have an equivalent in Python. E.g. | with_six_visits <- task_df %>% | group_by(turker_id, visit) %>% summarise(n_trials | = n_distinct(trial_num)) %>% | mutate(completed_visit = n_trials>40) %>% | filter(completed_visit) %>% summarise(n_visits = | n_distinct(visit)) %>% mutate(six_visits = | n_visits >= 6) %>% filter(six_visits) %>% | ungroup() | | Here I'm filtering participants in an mturk study by those | who have completed more than 40 trials at least six times | across multiple sessions. It's not that I couldn't do the | same transformation in pandas, but it feels very intuitive | to me doing it this way. | | - ggplot2 for plotting; its really powerful data | visualization package. | | Truthfully, I often do my data text parsing in Python, and | then switch over to R for analysis, E.g. python's JSON | parsing works really well. | vcdimension wrote: | R is used by many researchers and consequentially has many | more statistical libraries (e.g. try doing a dynamic panel | modelling in python). | civilized wrote: | Tabular data manipulation packages are better, easier to | make nontrivial charts, many R stats packages have no | counterparts in Python, less bureaucracy, more batteries- | included. | | R is a language by and for statisticians. Python is a | programming language that can do some statistics. | swayson wrote: | Julia, R (tidyverse), Python code examples available here: | | https://github.com/StatisticalRethinkingJulia | https://github.com/pymc-devs/resources/tree/master/Rethinkin... | https://bookdown.org/content/4857/ ___________________________________________________________________ (page generated 2022-01-16 23:00 UTC)