Dixon-Coles Algorithm for Football Odds
About this app
A Dixon-Coles Algorithm calculator based on the 1997 model for setting football match odds.
Dixon-Coles Algorithm for Football Odds Dixon-Coles Algorithm for Football Odds Enter the following parameters: Lambda 1 (λ1): Lambda 2 (λ2): Omega (ω): Calculate Odds
Related apps
Put this on your site
Source
<!DOCTYPE html>
<html>
<head>
<title>Dixon-Coles Algorithm for Football Odds</title>
<meta name='description' content='A Dixon-Coles Algorithm calculator based on the 1997 model for setting football match odds.'>
<meta name='keywords' content='Dixon-Coles, Football, Odds, Calculator'>
<script>
function factorial(n) {
return (n === 0 || n === 1) ? 1 : n * factorial(n - 1);
}
function tau(lambda1, lambda2, x1, x2, omega) {
if (x1 === 0 && x2 === 0) return 1 - lambda1 * lambda2 * omega;
if (x1 === 0 && x2 === 1) return 1 + lambda1 * omega;
if (x1 === 1 && x2 === 0) return 1 + lambda2 * omega;
if (x1 === 1 && x2 === 1) return 1 - omega;
return 1;
}
function calculateOdds() {
const lambda1 = parseFloat(document.getElementById('lambda1').value);
const lambda2 = parseFloat(document.getElementById('lambda2').value);
const omega = parseFloat(document.getElementById('omega').value);
let odds00 = tau(lambda1, lambda2, 0, 0, omega) * Math.exp(-lambda1) * Math.exp(-lambda2) / (factorial(0) * factorial(0));
let odds10 = tau(lambda1, lambda2, 1, 0, omega) * Math.exp(-lambda1) * Math.pow(lambda2, 1) / (factorial(1) * factorial(0));
let odds01 = tau(lambda1, lambda2, 0, 1, omega) * Math.pow(lambda1, 1) * Math.exp(-lambda2) / (factorial(0) * factorial(1));
let odds11 = tau(lambda1, lambda2, 1, 1, omega) * Math.pow(lambda1, 1) * Math.pow(lambda2, 1) / (factorial(1) * factorial(1));
document.getElementById('odds00').innerText = `Odds for (0, 0): ${odds00.toFixed(4)}`;
document.getElementById('odds10').innerText = `Odds for (1, 0): ${odds10.toFixed(4)}`;
document.getElementById('odds01').innerText = `Odds for (0, 1): ${odds01.toFixed(4)}`;
document.getElementById('odds11').innerText = `Odds for (1, 1): ${odds11.toFixed(4)}`;
}
</script>
</head>
<body>
<h1>Dixon-Coles Algorithm for Football Odds</h1>
<p>Enter the following parameters:</p>
<label for='lambda1'>Lambda 1 (λ1):</label>
<input type='number' id='lambda1'><br>
<label for='lambda2'>Lambda 2 (λ2):</label>
<input type='number' id='lambda2'><br>
<label for='omega'>Omega (ω):</label>
<input type='number' id='omega'><br>
<button onclick='calculateOdds()'>Calculate Odds</button>
<p id='odds00'></p>
<p id='odds10'></p>
<p id='odds01'></p>
<p id='odds11'></p>
</body>
</html>
NEW APPS
These are apps made by the community!