unitedSimOne: Simulating a formation

Description Usage Arguments Value See Also Examples

View source: R/unitedSimOne.R

Description

Simulates a formation against another formation.

Usage

1
2
unitedSimOne(home, away, r, penaltyProb = 0.1, preventGoalGK = 1/14,
  preventGoalSW = 1/15, hardnessMatrix)

Arguments

home

home team (an object of the S4class formation)

away

away team (an object of the S4class formation)

r

number of replications for the simulation of hardness and penalties, can be missing (exact results will be computed)

penaltyProb

occurrence probability of a penalty

preventGoalGK

factor multiplicied with the strength of the GK for computing the probability of preventing a goal by the goalkeeper

preventGoalSW

factor multiplicied with the strength of the SW for computing the probability of preventing a goal by the sweeper

hardnessMatrix

matrix matrix with eleven columns which contain the probability for yellow cards dependent on the used hardness

Value

Creates an object of the unitedSim class.

See Also

unitedSim

Examples

1
2
3
4
5
6
7
home <- formation(10, NA, c(7,5,3), c(8,8), c(10,10,8))
away <- formation(5, 8, c(8,8), c(10,10), c(10,10,10), 
 hardness = c(0,0,0,0,1))
set.seed(123)
unitedSimOne(home, away)
# you can even simulated the game
unitedSimOne(home, away, r = 100)

unitedR documentation built on Jan. 5, 2018, 5:07 p.m.