Statistics for Life — Using Stats to Find the Best Wifi Antenna Location
I attempted to learn stats in college. I guess I tried hard enough that they gave me a degree for it. But I went through most of college without using it for anything really that useful. It happens that I sort of like math so I persevered through the equations and proofs. But it wasn’t until after college that I started realizing that maybe this stuff has some utility for the average Joe ;). I have started noticing little places here and there that stats would actually be useful — like in a normal person’s life. Philosophically, I guess this makes sense since stats is the science of making order out of chaos and I don’t know about you but my life has a lot of chaos in it. I’ve used stats/probability to help me decide if I should wait on a standby list or buy the $500 ticket to ensure my flight. I’ve used it to decide if I should end my lease and pay a $3000 fine. I also am using it more and more in my machine learning experiments. I hope to write about those sometime. But today, I used stats to help me with a wifi install.
Here’s the setup. I don’t have great wifi in my room. Thankfully, I have a friend who knows a lot more about networking than me and he said that the electrical noise from my computer might be interfering with my onboard antennas — so I should buy some extended antennas and hang them on my wall. $15 and 2 days later and here they are.
But was my friend right? Do the antennas help? And do they help enough to justify the $15 and some annoying wires hanging down my wall? Great question but not so simple to answer because every time I run a speed test, I seem to get different results. Ugh. Stattssssss to the rescue!
I chose to focus on just a single metric for simplicity: download speed, measured in megabits per second (MBPS). First, I ran a few tests on my computer with the built-in antennas and recorded the results. How many trials is enough? Ahhh I don’t know: until I get bored. Apparently, that’s at 12 today (hey, before you get mad at me, I’ll have you know that the first t-test ever was done with four observations). If you want to one-up me, you could have conducted a power analysis but then you’d have to make a lot of assumptions and do a bunch of research until you‘re red in the face and I’ll be sitting back with a beer calling you a try-hard.
In case you’re interested in the results, and I guess you are because you’re still reading, here they are: [11.8, 16.4, 25.2, 17.9, 26, 10.7, 7.52, 6.84, 9.58, 10.5, 9.38, 1.61]. Not exactly clear performance, huh?
Alright, let's install the antennas. So the wire is 6 feet meaning I have a few options for where to install it. Let’s start with the least annoying place. Call this location 1.
Interpretation: this thing is a piece of junk and I need to return it and get friends with better advice. I could have taken more samples but honestly, I can see pretty clearly that this is not significantly better.
Let’s move to a different location: creatively named location 2. Taking some measurements — beep bop boop.
Ok now, this is getting interesting. These results do look a bit better. But are they better, enough? (Is that even correct grammar?) I bet our friend Mr t-test can tell us. On our way to visit him though, we have to pass his assumption-testing body guards of normality and equal variance testing. If you want tutorials or in-depth explanations of these things, there are plenty of resources out there but this is not one. Let’s use an alpha value of 0.05 for our work. Why? Cause it’s what all the cool kids are doing. An F-test for equal variance returns a p-val of 0.005 < 0.05 so we REJECT that variances are equal. Well, turns out we’ll have to visit Mr t-test’s more relaxed cousin, t-test-with-unequal-variances. And as for normality, well a Kolmogorov-Smirnov test tells us we’re way off on that. I guess we could bootstrap. But ah, it’s a Saturday. Saturday’s are my day off. So we’ll just tip-toe past that guard. So we get to the throne of Mr t-test-with-unequal-variances… he needs a better name. We ask him what the chance would be that the onboard signal was actually better than the antenna-signal given the data we got. Out of his mouth come the words pval=0.00024. AkA, “no-way-Jose”. As we’re being ushered out, we look over our shoulder to ask one more question, “well then what’s the improvement I get” and Mr. T (much better name) in his generosity tells us: 10 +- 5.
So we get back home satisfied and a little disappointed. The results are better but are they enough to justify $20 and ugly wires. In a desperate attempt, I tried one more super-ugly location.
These are obviously much better than onboard results and a visit to Mr. T tells us so too: improvement is 20 +- 5. Knowing that, I can make an informed decision if the visual appeal of my room is worth a basically guaranteed speedup of at least 15 MBPS… I think so!
Yes, and being the good citizen (more like show-off) that I am, I even left a review on Amazon.
Here are all my results plotted.
And that’s a wrap! See you later nerds!