# Testing what probability model to use

Suppose we have some random variable $X$ that ranges over some sample space $S$. We also have two probability models $F$ and $G$. Let $f(x)$ and $g(x)$ be the probability density functions for these distributions. Does the following quantity $$\log \frac{f(x)}{g(x)} = \log \frac{P(F|x)}{P(G|x)}- \log \frac{P(F)}{P(G)}$$ basically tell us how much more likely model $F$ is the true model than model $G$?

-

What is the difference between $\log\frac{f(x)}{g(x)}$ and the log likelihood ratio (LLR)? The value of the LLR does not depend on the a priori probabilities $P(F)$ and $P(G)$ at all.  In other words, there is cancellation on the right side of your displayed equation which makes the a priori probabilities disappear, and the LLR does not have any information about the a priori probabilities. – Dilip Sarwate Dec 20 '11 at 18:53

## 2 Answers

I am totally confused by the last comment made by Michael (the answer is ok, it is the link with logistic regression which went too far for me). Logistic regression is to be used when you have pairs of observations (X, Y) where Y is a binary variable (taking values in {0,1}) which is modeled as a Bernoulli variable $\mathcal{B}(p)$ the parameter of which depends of the value $x$ taken by $X$ : $\mathrm{logit}(p) = \beta_0 + \beta_1 x$. Here you don’t observe a variable Y taking value 1 when the model if F and 0 when it is G, the model is fixed beforehand and would not change along the observations... and you wouldn’t write $\mathrm{logit} P(F) = \beta_0 + \beta_1 x$. To me, this doesn‘t make any sense.

I will slightly reword Michael’s answer, just to give you some additionnal keywords. If you have a single observation $x$, then $f(x)$ is the likelihood of the model F, denote it by $L(F; x) = f(x)$, and $g(x)$ is the likelihood of the model G, denote it by $L(G;x) = g(x)$. As you stated, the likelihood ratio $L(F ; x)/L(G ;x) = f(x)/g(x)$ tells you how much the data support F against G.

If you have prior probabilities for F and G, denoted by P(F) and P(G) = 1 - P(F), then you can write posterior probabilities P(F|x) and P(G|x). You have $$P(F | x) = { L(F ; x) P(F) \over L(F;x) P(F) + L(G;x) P(G)},$$ $$P(G | x) = { L(G ; x) P(G) \over L(F;x) P(F) + L(G;x) P(G)},$$ and $${P(F | x) \over P(G |x) } = {P(F) \over P(G)} \times {L(F ; x) \over L(G ;x)}.$$ This is as Michael stated an application of Bayes’ theorem. The quantity P(F)/P(G) = P(F)/(1-P(F)) is called the odds of the model F. You can take the log of this last equality to get an additive statement, which is very usual (cf Michael’s answer). The quantity L(F;x)/L(G;x) is called a Bayes factor.

If you have $n$ independent observations $\mathbf{x} = x_1, \dots, x_n$, the same thing holds with $L(F ; \mathbf{x}) = \prod_i f(x_i)$ and $L(G ; \mathbf{x}) = \prod_i g(x_i)$.

-

I've deleted the logistic regression remark.  In logistic regression there are multiple observed instances of success or failure, each corresponding to an observed $x$ value.  In this case, there is only one one binary choice, between $F$ and $G$, and its outcome is not observed, but the conditional distribution of $X$ given $F$ or $G$ is known, and the conditional probabilities of $F$ and $G$ are sought. – Michael Hardy Dec 20 '11 at 22:09

I was slightly puzzled by the notation, but I'm assuming that by $P(F)$ you mean the probability that $F$ is the right model, and $P(F\mid x)$ is the conditional probability that $F$ is the right model given the event $X=x$.

The identity you write is then a form of a special case of what is sometimes called Bayes' theorem.

If one assumes the right model must be either $F$ or $G$, but not both, then one can say that $$\operatorname{logit} P(F) = \log \frac{P(F)}{1-P(F)} = \log(\operatorname{odds}(F))$$ increases by $\log(f(x)/g(x))$ when it is observed that $X=x$.

So that quantity tells you by how much the logit of the probability increases when you observe the data.

-

So $\text{logit} \ P(F) = \log \frac{P(F|x)}{P(G|x)} - \log \frac{f(x)}{g(x)}$. The first term plays the term of the intercept right? We need it to be of the form $\text{logit}\ P(F) = \beta_0+ \beta_{1}x$? – Tommy Dec 20 '11 at 3:26
Actually, $\operatorname{logit}(P(F\mid X=x))$ would be a function of $x$ that depends on what probability distributions $X$ has under $F$ and $G$. – Michael Hardy Dec 21 '11 at 15:20
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 50, "mathjax_display_tex": 5, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.952322781085968, "perplexity_flag": "head"}