Okay. So now.

How do you take a home score and make it into a probability?

Okay, this comes from Daniel McFadden, popularized this, won the Nobel Prize for

economics, for his emphasis on what he called, Discreet Choice,

which is a form of logistic regression.

And the marketing analytic's book has a chapter on this.

But Fadden found out and he was talking about market share like his

research was on what fraction of commuters in San Francisco,

that would take the Bay Area rapid transit as opposed to a car.

As you change the price and you change the quality of the Bay Area

rapid transit system, and he was very right on,

in predicting the percentage of riders that would take the Bart.

Okay, again the marketing analytic's book has much more detailed on the screen

choice, logistic progression.

But this is the logistic equation, okay?

And so basically, the chance that the home team wins would be E to the score,

divided by one plus E to the score, and that's called a logistic function.

Okay, so what we're going to do in the probably the home team wins,

it's E to the score, we don't know what these numbers should be yet,

divided by one plus E to the the score.

And probably the away team wins is one minus that.

Okay then we want to do log likelihood.

So if the home team won, we'd take the log of the home team probability of.

If the away team won, we take the log of the probability the away team won.

Okay?

And so then we add up these log likelihoods and maximize that.

So the log likelihood here.

I used an IF error.

Okay, if the home team won, I would take the log of the Home team wons.

Otherwise take, be a log that probably away teams wins,

and there's some rows here that have these stupid NA's, and so

I put a one in there, so the lock of one is zero its not going to effect anything.

So I add up all these log probabilities, and that's what I want to maximize.