ArticleslgStudy

mathematics

Phi coefficient

Phi coefficient is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Phi coefficient rather than just read about it. In short: In statistics, the phi coefficient, also known as the mean square contingency coefficient or Yule coefficient of correlation and commonly denoted by φ or rφ, is a measure of association between two binary variables. In machine learning and bioinformatics, it is known as the Matthews correlation coefficient (MCC).

Key takeaways

  • Phi coefficient belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Phi coefficient to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Phi coefficient from memory before moving on to harder problems.

Reference excerpt

In statistics, the phi coefficient, also known as the mean square contingency coefficient or Yule coefficient of correlation and commonly denoted by φ or rφ, is a measure of association between two binary variables. In machine learning and bioinformatics, it is known as the Matthews correlation coefficient (MCC). In meteorology and elsewhere, it is referred to as the Doolittle Measure of Association or Doolittle Skill Score. Described by Udny Yule in 1912 and given the name phi by Karl Pearson in the 1930s, it is a special case of the Pearson correlation coefficient.

Definition A Pearson correlation coefficient estimated for two binary variables will return the phi coefficient. Two binary variables are considered positively associated if most of the data falls along the diagonal cells. In contrast, two binary variables are considered negatively associated if most of the data falls off the diagonal. If we have a 2×2 table for two random variables x and y

where n11, n10, n01, n00, are non-negative counts of numbers of observations that sum to n, the total number of observations. The phi coefficient that describes the association of x and y is

φ=n11n00−n10n01n1∙n0∙n∙0n∙1. Phi is related to the point-biserial correlation coefficient and Cohen's d and estimates the extent of the relationship between two variables (2×2). The phi coefficient can also be expressed using only n, n11, n1∙, and n∙1, as

φ=nn11−n1∙n∙1n1∙n∙1(n−n1∙)(n−n∙1).

Maximum values In general, the Pearson correlation coefficient ranges from −1 to +1, where ±1 indicates perfect agreement or disagreement, and 0 indicates no relationship. The range of the phi coefficient—a special case of the Pearson correlation coefficient—is more tightly bound when either of the binary variables are class-imbalanced.

Meteorology In meteorology, the phi coefficient is referred to as the Doolittle Skill Score or the Doolittle Measure of Association, though this is actually off by a square root: Doolittle's original 1885 statistic matches phi squared, not phi itself. It was used by M. H. Doolittle in the 1880s to rate the accuracy of meteorologist John Park Finley's tornado predictions and other weather forecasts.

Machine learning The Matthews correlation coefficient (MCC) is widely used in the fields of bioinformatics and machine learning to evaluate the quality of binary (two-class) classifications. It is named for biochemist Brian W. Matthews, who described the measure in a foundational 1975 paper. The coefficient accounts for true and false positives and negatives and is generally regarded as a balanced measure which can be used even if the classes are of very different sizes. The MCC is in essence a correlation coefficient between the observed and predicted binary classifications; it returns a value between −1 and +1. A coefficient of +1 represents a perfect prediction, 0 no better than random prediction and −1 indicates total disagreement between prediction and observation. However, if MCC equals neither −1, 0, or +1, it is not a reliable indicator of how similar a predictor is to random guessing because MCC is dependent on the dataset. MCC is closely related to the chi-square statistic for a 2×2 contingency table

|MCC|=χ2n where n is the total number of observations. While there is no perfect way of describing the confusion matrix of true and false positives and negatives by a single number, the Matthews correlation coefficient is generally regarded as being one of the best such measures. Other measures, such as the proportion of correct predictions (also termed accuracy), are not useful when the two classes are of very different sizes. For example, assigning every object to the larger set achieves a high proportion of correct predictions, but is not generally a useful classification. The MCC can be calculated directly from the confusion matrix using the formula:

MCC=𝑇𝑃×𝑇𝑁−𝐹𝑃×𝐹𝑁(𝑇𝑃+𝐹𝑃)(𝑇𝑃+𝐹𝑁)(𝑇𝑁+𝐹𝑃)(𝑇𝑁+𝐹𝑁) In this equation, TP is the number of true positives, TN the number of true negatives, FP the number of false positives and FN the number of false negatives. If exactly one of the four sums in the denominator is zero, the denominator can be arbitrarily set to one; this results in a Matthews correlation coefficient of zero, which can be shown to be the correct limiting value. In case two or more sums are zero (e.g. both labels and model predictions are all positive or negative), the limit does not exist. The MCC can be calculated with the formula:

MCC=𝑃𝑃𝑉×𝑇𝑃𝑅×𝑇𝑁𝑅×𝑁𝑃𝑉−𝐹𝐷𝑅×𝐹𝑁𝑅×𝐹𝑃𝑅×𝐹𝑂𝑅 using the positive predictive value, the true positive rate, the true negative rate, the negative predictive value, the false discovery rate, the false negative rate, the false positive rate, and the false omission rate. The original formula as given by Matthews was:

N=𝑇𝑁+𝑇𝑃+𝐹𝑁+𝐹𝑃S=𝑇𝑃+𝐹𝑁NP=𝑇𝑃+𝐹𝑃NMCC=𝑇𝑃/N−S×PPS(1−S)(1−P) This is equal to the formula given above. As a correlation coefficient, the Matthews correlation coefficient is the geometric mean of the regression coefficients of the problem and its dual. The component regression coefficients of the Matthews correlation coefficient are markedness (Δp) and Youden's J statistic (informedness or Δp′). Markedness and informedness correspond to different directions of information flow and generalize Youden's J statistic, the δp statistics, while their geometric mean generalizes the Matthews correlation coefficient to more than two classes. Some scientists consider the Matthews correlation coefficient to be the most informative single score to establish the quality of a binary classifier prediction in a confusion matrix context.

Example Given a sample of 12 pictures, 8 of cats and 4 of dogs, where cats belong to class 1 and dogs belong to class 0,

actual = [1,1,1,1,1,1,1,1,0,0,0,0], assume that a classifier that distinguishes between cats and dogs is trained, and we take the 12 pictures and run them through the classifier, and the classifier makes 9 accurate predictions and misses 3: 2 cats wrongly predicted as dogs (first 2 predictions) and 1 dog wrongly predicted as a cat (last prediction).

prediction = [0,0,1,1,1,1,1,1,0,0,0,1] With these two labelled sets (actual and predictions) we can create a confusion matrix that will summarize the results of testing the classifier:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Phi coefficient

Start with the simplest possible case. Write down what Phi coefficient claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Phi coefficient before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Phi coefficient ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Phi coefficient

In research
Phi coefficient appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Phi coefficient in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Phi coefficient is common in secondary-school and first-year university syllabi. It links to neighbouring topics Bioinformatics, Cheminformatics, Computational chemistry, so understanding it makes those chapters shorter.
In everyday life
Look for Phi coefficient outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Phi coefficient” →

How to study Phi coefficient in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Phi coefficient means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Phi coefficient out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Phi coefficient in simple terms?

In statistics, the phi coefficient, also known as the mean square contingency coefficient or Yule coefficient of correlation and commonly denoted by φ or rφ, is a measure of association between two binary variables. In machine learning and bioinformatics, it is known as the Matthews correlation coe…

Why does Phi coefficient matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Phi coefficient?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Phi coefficient.

Tags

  • Bioinformatics
  • Cheminformatics
  • Computational chemistry
  • Information retrieval evaluation
  • Machine learning
  • Statistical classification
  • Statistical ratios
  • Summary statistics for contingency tables

Keep exploring