foot_prob {footBayes}R Documentation

Plot football matches probabilities for out-of-sample football matches.

Description

The function provides a table containing the home win, draw and away win probabilities for a bunch of out-of-sample matches as specified by stan_foot or mle_foot.

Usage

foot_prob(object, data, home_team, away_team)

Arguments

object

An object either of class stanfit as given by stan_foot function or list as given by mle_foot.

data

A data frame, or a matrix containing the following mandatory items: home team, away team, home goals, away goals.

home_team

The home team(s) for the predicted matches.

away_team

The away team(s) for the predicted matches.

Details

For Bayesian models fitted via stan_foot the results probabilities are computed according to the simulation from the posterior predictive distribution of future (out-of-sample) matches. For MLE models fitted via the mle_foot the probabilities are computed by simulating from the MLE estimates.

Value

A data.frame containing the number of out-of-sample matches specified through the argument predict passed either in the mle_foot or in the stan_foot function. For Bayesian Poisson models the function returns also the most likely outcome (mlo) and a posterior probability plot for the exact results.

Author(s)

Leonardo Egidi legidi@units.it

Examples

## Not run: 
### predict the last two weeks
require(tidyverse)
require(dplyr)

data("italy")
italy_2000<- italy %>%
 dplyr::select(Season, home, visitor, hgoal,vgoal) %>%
 dplyr::filter(Season=="2000")

fit <- stan_foot(data = italy_2000,
                 model="double_pois", predict =18)  # double pois

foot_prob(fit, italy_2000, "Inter",
          "Bologna FC")

foot_prob(fit, italy_2000) # all the out-of-sample matches

## End(Not run)

[Package footBayes version 0.2.0 Index]