SkepticalEmpiricist

- friends
364 link karma
421 comment karma
send messageredditor for
what's this?

TROPHY CASE

AskMath: Can you settle this voting dispute? by TitoTheMidgetin math

[–]SkepticalEmpiricist 0 points1 point ago

To clarify: there is only one winner in this election? You have a bunch of candidates going for one seat?

Or do you have multiple seats, perhaps you are electing a board of three people?

If you are electing multiple people, are they being elected to specific roles? Chairperson, treasurer, secretary ...? Do you have simultaneous elections where you need to ensure that one person is not allowed to win multiple elections? Or do you have one big election to elect three people to the Board?

Tell us what the context is, before we argue about the solution :-)

SetTimeouts are to blame for everything by willvarfarin programming

[–]SkepticalEmpiricist 1 point2 points ago

I don't think one-thread-per-tab will really directly affect this. The 'background' threads will still want to fire very often and waste bandwidth and cpu. We need to have a strict policy which hinders the background tabs, and this policy can be put in place with or without one-thread-per-tab

Statistics is not math... by t_rex_tullisin statistics

[–]SkepticalEmpiricist 1 point2 points ago

What worries me is that a lot of people in broadly 'numerate' disciplines, including even some people who think they are good at stats, are quite bad at understanding probabilities. The classic example is the p-value, many people can write down formulae but very few of them actually have a clue how to correctly interpret it. Or confidence intervals ...

I don't care what you call yourself, but if you want to make a contribution you must be good and understanding probabilities intuitively and be reasonably good at some parts of maths.

Just because you're good at maths, it doesn't mean you won't screw up the Monty Hall problem. Stats is built on parts of maths, but it also includes some skills and intuitions that are beyond some mathematical people.

my boyfriend is a physics teacher and this is what he made to help his students learn by sparkydogin Physics

[–]SkepticalEmpiricist 4 points5 points ago

I came here to downvote predictable sexual crap like this. I suspect people prefer original (and genuinely shocking) sexual jokes. Not this "look, a girl has posted something."

The Proof is Trivial! by tick_tock_clockin math

[–]SkepticalEmpiricist 2 points3 points ago

And, it fits into a margin.

Cache them if you can by tjanssonin programming

[–]SkepticalEmpiricist 4 points5 points ago

Is there any other way to organize caching? Perhaps the browser, when requesting a resource, should send a hash (MD5 or SHA1 or something) of the most recent version it has locally. Then the webserver could compare that with the hash of the most up-to-date version; if the hashes match, then there is no need to resend it again.

In general, the webserver should strive to include a hash of the resource when it is sending it to the browser. If the browser (or any intermediate machine) already has a resource with the same hash, then it can drop the connection immediately.

This technology wouldn't require that website designers be aware of caching. It would be a robust technology built into the webservers and browsers. Even better would be a scheme where the response headers for a HTML page will include the hashes of any images that are linked from the page. This could be really great; entire static websites could be cached based on one single hash.

Some of the hashing technology in technologies such as git would be useful.

(This is hardly a new idea. There must be a catch! What is it? )

Gelman proposes a synthesis of frequentist and bayesian approaches to data analysis by khafrain PhilosophyofScience

[–]SkepticalEmpiricist 3 points4 points ago*

The MLE is the most Bayesian of the Frequentist methods.

I have to think about this a little, but I think you're right here, p < 0.05 of course.

As is well known, the MLE is equivalent to taking the MAP (maximum a posteriori) with a Uniform prior. So the MLE is a Bayesian method. The question is: can it also be referred to as a Frequentist method? I think not, but I admit I haven't made much of an argument here. So I'll try to fill in some of the gaps I left.

It's often said that the MLE is consistent. Frequentists like to find estimators with nice properties, and consistency is nice. But then again, the MAP is consistent no matter what prior is used. In fact, if you are using Bayesian methods it is very difficult to come up with an estimator that is not consistent!

'Consistency' is just a fancy way of saying 'a method that will get the right answer if you throw sufficiently large amounts of data at it'.

In short, I would say that many Bayesian methods (including the MLE) pass the tests that are set by the Frequentists, and hence the MLE is no more Frequentist than many other estimators.

I accept that the MLE (i.e. the Uniform prior) has certain other properties which are deemed desirable by the Frequentist. So I'm not saying that the MLE belongs exclusively to Bayesian methods. But I am saying that a piece of research cannot describe itself as Frequentist simply because they used Bayesian models and used a Uniform prior. I would expect some attempt to analyze the bias of the estimator before referring to the work as Frequentist.

On another note, as I said in an earlier comment, many of the famous Frequentist methods (such as confidence intervals and unbiased estimators) are methods which make statements which hold true regardless of which prior is in effect. For example, an unbiased estimator must be shown to be without bias for all potential true values of the parameter. It is not sufficient for the bias to be absent merely for the most probable a priori potential true values of the parameter.

Contrast this with the MLE, which assumes a uniform prior. The fact that the prior is uniform is irrelevant - it could be any shape of prior - what is interesting is that a prior is used in the MLE. Also, there is no guarantee that the MLE will be inside the 95% confidence interval; on the contrary, the MLE will sometimes have been rejected by the confidence interval!

Consider a 95% Bayesian Credible Interval. Now change that interval by decreasing the confidence level from 95% slowly towards 0%. As you decrease the confidence level, we'll assume that we strive to keep to the interval which provides the narrowest interval. As the confidence level approaches zero, the Bayesian Credible Interval will converge on the MLE.

But if you do the same thing with a 95% Frequentist Confidence Interval, there is no guarantee that it will converge to the MLE as the confidence level approaches zero. This is a question I might investigate further sometime, perhaps it will converge on an unbiased estimator in some cases? Anyway, this is (in my very humble opinion) a better way to try to define a truly Frequentist analogue of the MLE.

I think Gelman's approach is right, and I hope I can summarize it here:

All models are wrong. Hypothesis testing is useless at the start because a zealous Frequentist can easily reject all useful hypotheses that we can write down. A Bayesian method is probably the best way to sift through the bad models and identify which is the 'least-worst' model and set of parameters. But once the 'least-worst' model and parameters have been identified, it might then be desirable to test if it is actually a good fit. It probably won't be a good fit, but that's OK. And if it's not a good fit, you may want to do some further analysis to get some clues as to what is different in the real data and the estimated model.

Gelman proposes a synthesis of frequentist and bayesian approaches to data analysis by khafrain PhilosophyofScience

[–]SkepticalEmpiricist 35 points36 points ago*

It's good to see somebody who actually understands the two approaches.

A significant number of people who think they are Frequentists are actually Bayesian. I've even seen Bayesian methods published which describe themselves as "Frequentist" merely because they have used the MLE. The MLE is the most Bayesian of the Frequentist methods.

And there's the persistent misinterpretation of significance and effect size. I'm sure the (competent) Frequentists are just as frustrated as the rest of us at this problem.

If you understand how to properly interpret the statements made by Frequentism and Bayesianism, you'll see that that rarely contradict each other. They tend to answer different questions, rather than provide competing answers to the same question.

The first footnote in that pdf is relevant also. It reminded me of thoughts I had recently. Imagine this general outline: You have (or will obtain) some data, and you are to make various inferences from the data. Therefore, you write down a model. Then, you create an estimator (a piece of software perhaps) which, given the observed data, will make estimates or will list hypotheses which have not been rejected. Finally, you wish the test your estimator and to make statements about how accurate your estimator is. "Is it an unbiased estimator?" "Is it a 95% Frequentist Confidence Interval?"

A Frequentist is more concerned with the final step; given an estimator (even a Bayesian estimator), the goal is to test it. The Bayesian is more concerned with how to construct an estimator in the first place. The Frequentist will often find that he gives the gold medal to an estimator that was created by Bayesian methods. And this is not a problem.

The question that can arise is that the Bayesian might not be interested in passing the tests that are set by the Frequentist. And with good reason sometimes. Things such as the Frequentist Confidence Interval are often misinterpreted, and hence it is not so important to strive to meet the Frequentist's goals at the expense of other goals.

The best way to understand the Frequentist techniques such as the Frequentist Confidence Interval and Unbiased estimators is not to think that they are methods that work without a prior. Instead, they do assume the existence of a prior, but Frequentists restrict themselves to statements which are true regardless of what the prior is. This makes the statements more robust, as fewer assumptions are required. But if you make too few assumptions, then you start to make useless statements. An example is "2+2=4". In order to make useful statements, you will need to make more and more assumptions. Sometimes, that means using fully Bayesian methods.

Finally, in my own work I do some clustering. We are usually not interested in identifying the 'correct' model, as usually we have no idea what really generated the data. (e.g. how often do we actually have real-world data that really is a mixture-of-Gaussians?) Therefore, we are not always interested in rejecting hypotheses. All the hypotheses are trivial to reject, because the models we are using are too simple. But we can't halt research waiting for the perfect model is found. You have to play with the simple models and publish your results. Given a parameterized model, a Frequentist might reject all the possible parameters values! This would might achieve nothing, if all you want is the least-worst-fit among the space of models.

Before arguing about the technicalities (Frequentist versus Bayesian) make up your mind what question you want to ask of the statistician.

"Scientists say..." by AndreasBWagnerin PhilosophyofScience

[–]SkepticalEmpiricist 0 points1 point ago

He's been burned by bad papers in the past.

Before entering academia I was burned in other ways. I used to have certain, simplistic, views on economics. But in late 2007, as the credit crunch was in the news, I made a point of reading a lot about economics and more broadly about philosophy. I changed my mind about a lot of things. It was a humbling experience, at the age of 27 to have most of my certainties turned upside down.

Maybe I'm still wrong on all those topics, but it was still a great experience. I believe that many people, especially academics and others who are effectively the decision-makers in our societies, need to be humbled like this more often.

"Scientists say..." by AndreasBWagnerin PhilosophyofScience

[–]SkepticalEmpiricist -1 points0 points ago

I wouldn't only blame the media for this. The scientists themselves fall into this trap. I'm a research student, and in my experience the senior academics can be extremely conservative and will believe anything that is 'peer-reviewed', even if in a very unprestigious journal.

Many scientists enjoy basking in glory in front of the ill-educated masses, pretending they are smarter than they are.

Modern C++ Style [pdf] by guepierin cpp

[–]SkepticalEmpiricist 0 points1 point ago

I agree now. I think I was slightly put out at the lack of a standard make_unique (see this thread). But that's not really a problem, and it's easy to implement.

The Sleeping Beauty problem - probability's version of the "airplane on the treadmill" by Drunken_Economistin math

[–]SkepticalEmpiricist 0 points1 point ago

I agree, that's my point. But from the point of view of Sleeping Beauty, when she wakes up she is trying to work out which one of those interviews she is in. She is in one, and only one, of those interviews.

I think the error that some people make is the confuse "there will be a T_Mo interview" with "this current interview is the T_Mo" interview". The three "current interview" states are mutually exclusive. But, as you point out, the "will this interview occur?" events are not exclusive.

The Sleeping Beauty problem - probability's version of the "airplane on the treadmill" by Drunken_Economistin math

[–]SkepticalEmpiricist 2 points3 points ago*

I came across this on reddit a few days ago (repost?), and have since blogged about it.

That's not a very formal blog post by me though. I've been reading the Halfer piece by David Ellis recently and I think I'm ready to write something more formal to clear this up.

I'll try to properly disect the Halfer argument at some point, and maybe put a pdf on arXiv or something, but first I'll lay out a more thorough Thirder argument here.

Let's tweak the problem very slightly. As usual, if the coins is Tails, she will be woken twice, on Monday and on Tuesday, and interviewed each time with a dose of the drug on Monday night. No change there. But I propose to make a small change to the experiment when the coin is Heads.

In the standard experiment, if the coin is Heads, then Sleeping Beauty(SB) is woken once. In particular, she is woken on Monday. I propose instead to introduce a secondary coin (another fair coin) to decide which day she will be woken on. If the primary coin was Heads she will be woken exactly once, the secondary coin is merely to decide whether to wake her on Monday or on Tuesday. If she is to be woken only on Tuesday, she will be given a sedative to keep her asleep throughout Monday.

The other change is that we will tell her the day of the week before asking her whether the coin was Heads or Tails. How will this affect her answer? I'll show now that it makes no difference, and hence this 'modified' problem is effectively identical to the original problem.

The two potential events are int_Mo and int_Tu, i.e. the potential interviews on Monday or Tuesday. The following should be clear:

P(int_Mo | primary = Tail) = 1
P(int_Tu  | primary = Tail) = 1
P(int_Mo | primary = Head) = 0.5
P(int_Tu  | primary = Head) = 0.5

Now let's imagine that SB has been woken and has been told that it is Monday. She now tries to work out if the (primary) coin was Heads or Tails.

 P(Heads | int_Mo) = P(int_Mo | Heads) * P(Heads) / P(int_Mo)
                   =             1             *    0.5       /    0.75

You might be a little confused by P(int_Mo)=0.75. Remember that, if Tails she will definitely be interviewed on Monday, P(int_Mo | Tails) =1, and if Heads there is a 50/50 chance of being interviewed on Monday, P(int_Mo | Heads) =0.5. The average of these two, 0.75, is the probability, from the vantage point of the start of the experiment, that she will be interviewed on Monday.

 P(Tails | int_Mo) = P(int_Mo | Tails) * P(Tails) / P(int_Mo)
                            =         0.5         *    0.5    /    0.75

This is a basic application of Bayes' Theorem, and nobody will object that, if told that it is a Monday (in this modified experimental setup) that SB will be a Thirder, P(Heads | int_Mo) = 0.333. If Tails, the Monday interview will definitely happen, therefore if you condition on "it's Monday and I have just been awoken" then the coin probably was Tails.

And if SB is told that it is Tuesday, she will give the same answer. P(Heads | int_Tu) = 0.333 also. In fact, she will give the same answer regardless of whether or not she is told the day of the week. She will already have decided her answer before being told the day of the week. In that case, you may as well not tell her the day of the week. Therefore, this modified problem is actually identical to the original problem. If the (primary) coin is Tails, she will be woken and interviewed exactly twice; if Heads she will be woken and interviewed exactly once. The day of the week doesn't matter, it's the number of interviews that is the important factor.

So I hope it's clear that, in this slightly modified experiment, the Thirder position is correct. There is perhaps room for argument as to whether this experiment is sufficiently identical.

The original formulation is difficult to reason clearly about. Most probabilistic models involve a single time point where the question is asked "what state are we in?" But in the Sleeping Beauty problem there are multiple timepoints. SB is not only dealing with confusion as to which timeline she is in, but also trying to reason about "what time-offset am I at in the timeline?"

For example, returning to the original formulation, the three possible interviews maybe be identified as:

  H_Mo  :  A Monday interview where the coin was Heads
  T_Mo  :  A Monday interview where the coin was Tails
  T_Tu   :  A Tuesday interview where the coin was Tails

The following is true:

  P(there will be a H_Mo interview) = 0.5
  P(there will be a T_Mo interview) = 0.5
  P(there will be a T_Tu interview) = 0.5

i.e. at the start of the experiment, the chance that there will be an interview on Tuesday is 0.5, and the chance that there will be an interview on Monday is 1.0. The 1.0 is 0.5+0.5

So, even though those three events feel 'distinct' and 'mutually exclusive', the sum of their probabilities is 1.5. This sounds mad, but it just clarifies that two interviews will happen if the coin is Tails.

(Extra: Those three events are not mutually exclusive. However, when SB wakes up, she might be wondering which one of the events is currently in force. Therefore we must draw a distinction between 'there will be a H_Mo interview' and 'the current interview is a H_Mo interview'.)

I would like to write

 P(interview | Tails) = 2

in order to say that two interviews will happen if the coin is Tails, but nobody will like seeing a probability greater than 1. This is why I tweaked the problem above. It allowed me to split 'interview' into 'int_Mo' and 'int_Tu' which allows us to deal properly with mutually exclusive events.

The Thirders have it.

The Sleeping Beauty problem - probability's version of the "airplane on the treadmill" by Drunken_Economistin math

[–]SkepticalEmpiricist 1 point2 points ago

There is no "new" information, but there certainly is other relevant information. In particular, if the coin is tails, Sleeping Beauty knows that she will be asked the question twice. This interesting fact needs to be described and encoded somehow. How do you write

  P(interview | tail) = 2

? :-)

Modern C++ Style [pdf] by guepierin cpp

[–]SkepticalEmpiricist 1 point2 points ago

Maybe unique_ptr would suffice? There is an example of unique_ptr in those slides. Here is how you might do a tree:

 struct Node {
     unique_ptr<Node> left, right;
 };

This should work with many compilers, although technically this is not required by the standard. As far as I know, you shouldn't really template on a type which isn't fully defined yet. But I think there was talk of making that officially-well-defined behaviour in the language.

I do agree with the original post that 'raw' pointers should be very very much avoided where possible. I'd be inclined to use shared_ptr by default until I feel the need to optimize.

The most interesting statistical paradoxes by PARSLEYsagein statistics

[–]SkepticalEmpiricist 0 points1 point ago

The 'past state' refers to a time when you knew what the model was, but when you hadn't observed all the relevant data. For example, when the question started with:

"In a family with two children, ..."

then you knew then that A,B,C and D were all equally likely. Then, you hear that

"... one of the children is a girl, ..."

and this allows you to strike D from the list. Also, this knowledge does not change the relative weights of A,B,C; the posterior probability of D has dropped to zero, and the posterior probabilities of the other three options is 33% each.

In the beginning, you have very little information. Then you are told that there are two children, this narrows the options to ABCD. Then, you are told that one of them is a girl, this rules out D.

The most interesting statistical paradoxes by PARSLEYsagein statistics

[–]SkepticalEmpiricist 0 points1 point ago

If a family has two children, there are a four possibilities;

  • A) Girl, Girl
  • B) Girl, then Boy (oldest is Girl)
  • C) Boy, then Girl (oldest is Boy)
  • D) Boy, Boy

Each of those has equal probability; i.e. 25% chance. The chances of having "at least one Girl" is therefore 75% = A + B + C.

So, we are told that there is at least one girl. That rules out D. This leaves us with A,B and C. Each of A, B, C were equally likely a priori and now they are still equally likely; 33% each.

  • If A, then both children are Girls.
  • If B, then there is only one Girl.
  • If C, then there is only one Girl.

Therefore, the chance that both are girls is 33%. i.e. the probability of A versus the probability of A+B+C.

Interview with Nicolai Josuttis about C++11 and his new book -- he doesn't use C++ any more nor followed the standardisation process by milliamsin cpp

[–]SkepticalEmpiricist 10 points11 points ago

This in incorrect.

"lambdas have drawbacks as well -- they provide local behavior (as do function objects), but they don’t maintain a state between multiple calls. In this respect, function objects are still a better choice."

I suppose I am being a little pedantic. Check on this demo on ideone. The state of the lambda object has changed between calls.

Rvalue reference pitfalls by beriumin cpp

[–]SkepticalEmpiricist 0 points1 point ago*

Thomas Becker's article on rvalue-refs is good.

As far as I can see, there are exactly three differences between && and &. They are more similar than you might think. The really cool thing is how powerful these low-level differences become when they are used to implement move semantics.

  1. (not really relevant, but interesting) In C++03, you can extend the life of temporary with const T & x = bar();. With C++11, you now have the option of using a non-const reference if you wish, but it must be an rvalue-ref. T && x = bar();

  2. When the compiler is selecting from an overloaded set of functions (or methods), the compiler will compare the type of the function's parameters to the type and value class of the item you wish to pass to the function. Interestingly, the type of the item being passed in is not as important as the value class (i.e. rvalue-vs-lvalue). The method with && in its signature will only be a candidate if both these conditions hold:

  • 2(a). You must be passing in an rvalue, not an lvalue. i.e. foo(bar()), not foo(y). (In particular, rvalue-refs are not necessarily rvalues, as pointed out in the original article.)
  • 2(b). The type of bar() must either be T&& or T, not T&.

.3. There is also a change to template parameter type deduction, as described on page 8 of the article by Thomas Becker I linked to above.

There may well be other differences, but I found this sufficient to understand the issues I've come across in my initial forays into C++11.

When does the expectation of a ratio equal the ratio of expectations? And when does it hold approximately? by AlpLyrin statistics

[–]SkepticalEmpiricist 0 points1 point ago*

For certain well-behaved distributions, it should, I think, be exact if X and Y are independent of each other. (I was wrong here. See the reply below by PARSLEYsage).

Beware of weirdness with some distributions. If X and Y are each standard normals N(0,1), then X/Y is a Cauchy distribution. The Cauchy is a pretty funny distribution, it has no mean or variance, but it does have a median.

Each square of a chessboard contains a number. The sum of the two largest numbers in each row is the same. The sum of the two largest numbers in each column is also the same. What is the maximum possible difference between the two sums? by cotpiin CasualMath

[–]SkepticalEmpiricist 1 point2 points ago

I've made a little progress, but I don't have an answer yet....

Assume that it's 64 distinct numbers. (I think this can be relaxed, but it gets too complicated. Let's solve this simpler case first.)

Find the two largest numbers. These two numbers cannot share the same row or share the same column, as it would not be possible for any other two numbers to have the same sum.

We can extend this to say that the largest 8 numbers must all be on distinct rows and on distinct columns: Name the largest numbers A,B,C,D,E,F,G,H where A is the largest and H is the smallest. If two of these did share the same row, then their sum would be at least G+H. It also follows, that the must be some other row which does not include any of the top eight numbers. The sum of two entries from that row must be less than G+H. This contradicts the rule that the sum of the top two is the same for each row. Therefore, the top eight numbers never share a row or column.

I think that's OK so far. The question is: can we extend this to say that the next eight highest numbers (I,J,K,L,M,N,O,P) must also never share a row or column?

Think Complexity: Part Four. Small world graphs and scale free networks. by AllenDowneyin statistics

[–]SkepticalEmpiricist 0 points1 point ago

That name can be confusing because it is the distribution of degrees that is scale-free, not the network.

I'm glad I'm not the only person frustrated by this naming! I do research in networks, and I find this naming quite frustrating. There is some research into networks which are self-similar or fractal (first couple of papers here) - these are the networks which we should be calling 'scale-free'.

But unfortunately the degree-distribution-fetishists have stolen the name 'scale-free'. If the degree distribution is scale-free, then it is a "network with scale-free degree distribution" and I would prefer not to call it a "scale-free network".

So my boyfriend gave me my Valentines Day gift early. by freudisfailin math

[–]SkepticalEmpiricist 1 point2 points ago

How would that work? What's the sexual innuendo with 'choice'? For every pair of people/animals/objects, there is a way for them to have sex, even if we don't know what it is?

So my boyfriend gave me my Valentines Day gift early. by freudisfailin math

[–]SkepticalEmpiricist 12 points13 points ago

There'll be some (axiom of) pairing tonight.

view more: next