prediction_interval: Point estimate function and confidence intervals for football...

Description Usage Arguments Value Examples

View source: R/predictions.R

Description

This function returns point estimates and a confidence interval for the number of home and away goals scored in a match.

Usage

1
prediction_interval(data, estimate, teamname, method = "future")

Arguments

data

Output of all_game_data with parameter team = NA

estimate

Output of estimate_params using the same data

teamname

The name of the team of interest as a string

method

Optional parameter which takes the values "all", "past" or "future" to filter predictions

Value

A description of the columns of prediction data frames, upcoming and future:

Home L Lower bound of confidence interval for the predicted number of goals scored by the home team
Home Estimate Prediction of the number of goals scored by the home team, rounded to one decimal point
Home U Upper bound of confidence interval for the predicted number of goals scored by the home team
Away L Lower bound of confidence interval for the predicted number of goals scored by the away team
Away Estimate Prediction of the number of goals scored by the away team, rounded to nearest integer
Away U Upper bound of confidence interval for the predicted number of goals scored by the away team
Note H The number of stars indicate the width of the confidence interval for the home team. The more stars the larger the interval
Note A The number of stars indicate the width of the confidence interval for the away team. The more stars the larger the interval
Predicted result Home and away intervals are compared and H,D,A is returned based on the prediction
Final Score For a completed match the final full time score is given here

Examples

1
2
3
4
5
6
7
my_games <- all_game_data(amateuR::kreisliga_goettingen)
estimate <- estimate_params(data = my_games, alpha = 0.9)

prediction_interval(
  data = my_games, estimate = estimate,
  teamname = "RSV Göttingen 05", method = "all"
)

Niklas191/amateuR documentation built on Oct. 30, 2019, 10:14 p.m.