Wednesday, July 2, 2008

Why Bayes Rules

I need to stop reading this stuff. The opening discussion on induction and the in ability to come to the "correct" conclusion in the case of the crows and to decide between green and grue emeralds was particularly annoying. In the first case, the statement all crows are black is considered. This statement is problematic because, if it is true, one could never rationally conclude that it is true unless you observe all crows.

In a slightly more complicated example, Nelson Goodman considered the statement, "all emeralds are green" and the statement "all emeralds are either green or blue (grue)". He then noted that if it is true that all emeralds are green, then the observation of any number of emeralds is equally consistent with either of these two statements.

The author then resolves this by suggesting that these statements should be rephrased to take the form "all but finitely many crows are black, i.e. 70% are black". Ignoring the incorrect use of the word finitely, this is considered acceptable as it represents (to the author) a statement which can be reasonably accepted after observing a finite amount of data and is asymptotically reliable.

Anyway, what kills me is that this problem has a normative solution provided you're willing to give up the impossible dream certainty in the presence of finite data. Moreover, that solution doesn't require you to give up on very reasonable statements like all emeralds are green, just that you acknowledge that you can only come to a conclusion of that sort with a confidence level which corresponds to a probability level that the statement is correct that is less than one. Here, for example, is the Bayesian Laplacian approach to the emerald problem.

Suppose that you have N emeralds and all are green. The quantity of interest is the probability that hypothesis one (H1 = all emeralds are green) is true divided by the probability that hypothesis two (H2 = all emeralds are grue) is true.

Clearly,

P(N Green Observations/NG0 | H1 = true) = 1

while hypothesis 2 has a hidden parameter, theta, which gives the percent of emeralds which are green. Marginalizing out this parameter implies...

P(NGO | H2 = true) = \int p(NGO | theta, H2)*p(theta | H2) dtheta

Utilizing the Jeffreys prior for p(theta | H2)dtheta this yeilds

P(NGO | H2 = true) = \int theta^n/sqrt(theta*(1-theta))/pi dtheta
= Gamma(N+1/2)/Gamma(N+1)/sqrt(pi)

where Gamma is the Gamma function.

In the limit as N goes to infinity P(NGO | H2) goes to zero indicating that this form of inference is asymptotically efficient. More importantly, however, for N=30 observations of green emeralds P(NG0|H2) = 0.05 indicating that, even a small amount of data can lead to a 95% confidence in the conclusion that all emeralds are green. Meanwhile, it is still the case that a single observation of a blue emerald is sufficient to reduce this confidence to zero.

As an added benefit this method can also be used to predict (at any time) the probability that a blue emerald will be found, i.e we can compute P(Blue Emerald | NGO), which gives the probability that we will change our mind the next time we see an emerald.




Of course, we could also have take the authors suggestion and, instead of hypothesis testing, we could have asked simple what is the probability that non-green emeralds exist given that we have observed N green emeralds. This requires ignoring H1 completely, and instead computing

p(theta | NGO) = theta^N / pi / sqrt(theta*(1-theta)) / p( NGO | H2 )



Curiously, in this case, the probability that your conclusion that all emeralds are green will eventually be proven incorrect is bounded from below by 1-exp(-1/2) \approx 0.4 That is, no matter how many observations of green emeralds you have observed there is at least a 40% chance that you will eventually observe a green emerald.

Similarly, the probability of failing to observe N additional green emeralds after having already observed N green emeralds, i.e. the probability of failing to replicate your observations is bounded from below by 1-exp(-1/4) \approx 0.22 even as N goes to infinity.

Wednesday, June 25, 2008

When did deep theory become synonimous with inane sophistry? The Rookie Error

In this article from that bastion of learned discourse, Discover Magazine, a physicist is interviewed regarding his 'scientific' theory that the universe is actually made of mathematics, or as he puts it, "there is only mathematics; that is all that exists." At first, this article caught my eye because i thought/hoped that he was making a clumsy epistemological statement regarding the necessity for formal, i.e. mathematical, explanations of physical phenomena, and that heuristic reasoning should be appreciated for its utility in guiding avenues of inquiry but should not be trusted if it can't be formalized. I had even naively hoped that, en route, he was simply going to point out that it is unwise to confer metaphysical significance to the various latent (explanatory) variables of a given theory. Or even to commit to a single theory but rather to accept them in proportion to their relative likelihood given observations, i.e. take a fully Bayesian approach.

Unfortunately, i was wrong on all counts. Honestly, i should know by now that far too many scientists really do believe that the latent variables of their theories have metaphysical significance. So much so that when fundamental theories begin to posit the existence of increasingly abstract entities, at least one physicist is forced to conclude that abstraction is the only thing with metaphysical significance and that all abstract theories (though presumably just the self consistent ones) give rise to universes in which those theories hold.

The article even includes a direct quote which I always affiliate with this kind of pseudo scientific cosmology. Regarding the level 2 multiverse: "No, they share the same space, but we could never communicate with them because we are all being swept away from each other as space expands faster than light can travel." Untestable is unscientific. The interviewer seems to sense that something is fishy and does ask about testable predictions to which the interviewee responds by saying yes there are testable predictions but then, instead of listing any, he effectively seems to say that all we have to do is figure out how things look from outside the universe....unfortunately, the interview ended before we could be told how to accomplish that without firing up a doobie.

Seriously, we need to remember that science is nothing more than prediction and data compression. At best we might say that the Data, being immutable, does have some special significance, but metaphysical significance, even of the data, is irrelevant to scientific inquiry. As such, we might as well take Occam's advice and shave away that pretentious beard, it looks better in a humanities department anyway.

Tuesday, June 3, 2008

Google Side Bar


In response to a few querries here's a screenshot of my desktop. I have been trying to keep it cleaner that i used to and Vista's launcher and integrated search make it pretty easy. The SimpleDrive is the external device which has all my reasearch and media files. Maxtor Manager is the tool i use to backup the external drive onto another external drive. On the right is my google sidebar which has the standard weather and gcalendar gadgets as well as the Google Desktop email Gadget and todo gadgets. Below that is gdTunes which controls iTunes (or winamp) and a wikipedia search window. I find the email gadget to be particularly useful. Not only can you expand it to view any particular email, but I use it to keep an ever present list of all the emails which still require a response.

UPDATE: Apparently there is a need to know what's going on with my Icon tray as well. Here is a closeup.



From left to right the icons are: Divx, Itunes, Last FM, Itunes again (I think that sometimes this happens when the Ipod is plugged in?), Safely Remove Hardware, Dell Support Center, Logmein (Best VNC ever!), SigmaTel Volume Panel, Fingerprint Software, Touchpad, GoogleDesktop, Webcam, maxtor Automated Backup, Trend PCillin, Agea Physics engine, Google Calendar Sync, Battery, Wireless, Global Volume Control. Of course, now that i've scrutinized this list i will probably remove Maxtor and SigmalTel. I still haven't decided about PCillin. On the desktop at home I also have Simplify Mobile media and the Signal Remote Control going on down there.

And here how, firefox quick access is setup:


Google is Google, Orb is for streaming media to the Ipod/Iphone. Remote access is Logmein for getting to my home pc and Last.fm is social networking/music finding which I am only just now giving a try.

Monday, May 26, 2008

Wirelessly Sync Iphone Calendar with Nemus

Ok, to wirelessly sync your iphone calendar with any google calendar do the following:

In the installer, select System and then install NemusSync.

Since Nemus is only for 1.1.1-1.1.2 versions of the OS it will crash when you try to point it to your gmail account. Here's the workaround that worked for me.

Open up your terminal app and su to root or ssh in from your pc. Type the following commands:

ln -s /var/mobile/Library/Calendar/ /var/root/Library/Calendar
chown -R mobile.wheel /var/Applications/NemusSync.app

Now this is important. When you point Nemus to your new account hit the Get Calendar List button before you hit the Save button. Then all is well.

Note if you currently sync your Calendar with Itunes (or sync your gCalendar with Outlook and then sync Outlook with your Iphone using Itunes) this will create duplicate entries. Fortunately, Nemus comes with a button in the Advanced Menu which allows you to delete your iphone Calendar and start fresh. I haven't had the guts to try to upload events from the iphone to the gCalendar yet, so if anyone has success with that let me know.

View Windows Media/Avi files on Iphone

It doesn't exactly work the way you want, but if you have a mycast.orb.com account and either a wireless or edge connection, then you can stream avi files from your pc at home to your Iphone. Here are the instructions:

(1) Install the lastest version of Orb, obtained here.

(2) Create an Account (and make me your friend!)

(3) Right click on the orb tray icon then select Configuration and point it to the directories which contain you audio and video files you would want to view/share.

(4) In the Iphone Installer goto multimedia and select Orb Live. Once installed just give it your login and password and your ready to go.

(5) To actually view your movies select the movie button at the bottom, then select Folders to browse the file structure you pointed orb to in step 3. Find the file you want and enjoy.

Vista Crash Count (Update)

Add one more blue screen to the count: screen saver went on and vista went off.

Wednesday, May 21, 2008

Ipod/Iphone: Best Hack Ever

I followed these instructions and yes now i can login and remotely control my desktop at home using the ipod and can do so from anywhere in the world. Watch the demonstrations they're pretty cool and even a cheap bastard like me agrees that $15 per phone/ipod is quite a reasonable price to pay to be able to login to any computer to which you have vnc access. Unfortunately, I couldn't make it work with the Vista laptop but that seems to have more to do with the TightVNC server than anything else. I will give it another try soon as some people have had luck with UltraVNC on vista.