simMatch: simMatch

Description Usage Arguments Details Value

Description

simulate a match between two players, given the probability of each player winning a point on their serve

Usage

1
2
3
simMatch(pA, pB, sets = c(3, 5), tiebreaks = TRUE, currentScore = c(0, 0),
  finalSetTiebreak = FALSE, players = c("A", "B"), detail = FALSE,
  p2A = NULL, firstServeA = NULL, p2B = NULL, firstServeB = NULL)

Arguments

pA

probability of player A winning point on their serve

pB

probability of player B winning point on their serve

sets

number of sets to be played

tiebreaks

play tie break at 6-6, or keep playing

currentScore

current set score

finalSetTiebreak

play tie break at 6-6 in final set

players

player names, vector of length 2

detail

return detailed data for the Match, default FALSE

p2A

probability of player A winning point on their second serve

firstServeA

probability of player A getting their first serve in

p2B

probability of player B winning point on their second serve

firstServeB

probability of player B getting their first serve in

Details

minimum input required is the probability that each player will win a point on their serve, however additional parameters include probability of each player winning a point on their second serve, the probability of a players first serve being in, number of sets whether they play a tiebreak

Value

1 (if player A wins) or 0 (if player B wins). If the parameter detail is set to TRUE, then the function will return a detailed list about the simulated match, including data about the indvidual sets and games in the match. This list can be converted to a dataframe using simDf. See simMatches for simulating many sets between the two players.


durtal/servevolleyR documentation built on May 15, 2019, 6:02 p.m.