R/serve_update.R

Defines functions serve_update

#' @export
serve_update <- function(won, points, prior){
			
			assign.weight <- function(points){
			 n0 <- 7500
			 n0 / (n0 + points^2)
			}		
			
			if(points == 0)
				prior
			else{
				W <- assign.weight(points)
				W * prior + (1 - W) * (won / points)
	}
}
skoval/inmatch_api documentation built on Jan. 20, 2020, 4:14 a.m.