BTdecay {BTdecayLasso} R Documentation

## Bradley-Terry Model with Exponential Decayed weighted likelihood

### Description

Exponential decay rate is applied to the likelihood function to achieve a better track of current abilities. When "decay.rate" is setting as 0, this is a standard Bradley-Terry Model whose estimated parameters are equivalent to package "BradleyTerry2". Further detailed description is attached in BTdecayLasso.

### Usage

BTdecay(dataframe, ability, decay.rate = 0, fixed = 1, iter = 100)


### Arguments

 dataframe Generated using BTdataframe given raw data. ability A column vector of teams ability, the last row is the home parameter. The row number is consistent with the team's index shown in dataframe. It can be generated using BTdataframe given raw data. decay.rate The exponential decay rate. Usually ranging from (0, 0.01), A larger decay rate weights more importance to most recent matches and the estimated parameters reflect more on recent behaviour. fixed A teams index whose ability will be fixed as 0. The worstTeam's index can be generated using BTdataframe given raw data. iter Number of iterations used in L-BFGS-B algorithm.

### Details

The standard Bradley-Terry Model defines the winning probability of i against j,

P(Y_{ij}=1)=\frac{\exp(τ h_{ij}^{t_{k}}+μ_{i}-μ_{j})}{1+\exp(τ h_{ij}^{t_{k}}+μ_{i}-μ_{j})}

τ is the home parameter and μ_{i} is the team i's ability score. h_{ij} takes 1 if team i is at home, -1 otherwise. Given, a complete tournament's result. The objective likelihood function with an exponential decay rate is,

∑_{k=1}^{n}∑_{i<j}\exp(-α t_{k})\cdot(y_{ij}(τ h_{ij}^{t_{k}}+μ_{i}-μ_{j})-\log(1+\exp(τ h_{ij}^{t_{k}}+μ_{i}-μ_{j})))

where n is the number of matches, α is the exponential decay rate and y_{ij} takes 0 if i is defeated by j, 1 otherwise. t_{k} is the time lag (time until now). This likelihood function is optimized using L-BFGS-B method with package optimr and summary() function with S3 method can be applied to view the outputs.

### Value

List with class "BT" contains estimated abilities and convergent code, 0 stands for convergence reaches, 1 stands for convergence not reaches. If 1 is returned, we suggest that decay rate should be set lower. Bradley-Terry model fails to model the situation when a team wins or loses in all matches. If a high decay rate is considered, a team who only loses or wins 1 matches long time ago will also causes the same problem.

 ability Estimated ability scores convergence 0 stands for convergent, 1 stands for not convergent decay.rate Decay rate of this model

### Examples

##Initializing Dataframe
x <- BTdataframe(NFL2010)

y <- BTdecay(x$dataframe, x$ability, decay.rate = 0, fixed = x$worstTeam) summary(y) ##Dynamic approximation of current ability scores using exponential decayed likelihood. ##If we take decay.rate = 0.005 ##Match happens one month before will weight exp(-0.15)=0.86 on log-likelihood function z <- BTdecay(x$dataframe, x$ability, decay.rate = 0.005, fixed = x$worstTeam)