Giter VIP home page Giter VIP logo

elooptimized's Introduction

EloOptimized

R-CMD-check CRAN_Status_Badge

Package website

EloOptimized provides tools to implement the maximum likelihood methods for deriving Elo scores as published in Foerster, Franz et al. (2016). Chimpanzee females queue but males compete for social status. In addition, it provides functionality to efficiently generate traditional Elo scores using a simplified procedure that doesn’t require the use of cumbersome presence matrices. Finally, it quickly generates a number of additional Elo-based indices (ordinal, normalized, cardinal, and categorical ranks and rank scores) of potential use to researchers, as outlined in the linked manuscript.

Installation

# Current version on Github:
# install.packages("devtools")
devtools::install_github("jtfeld/EloOptimized")

# CRAN-approved version on CRAN:
install.packages("EloOptimized")

Example

There are two functions of interest. Use eloratingopt() to calculate Elo scores using optimized Elo parameter values, or eloratingfixed() to calculate Elo scores using user-defined parameter values.

# to generate Elo scores using fixed initial Elo scores (1000) and a ML-fitted value for the K parameter:
nbaelo = eloratingopt(agon_data = nba, fit_init_elo = FALSE)

# to generate Elo scores using fixed default initial Elo scores and default K:
nbaelo = eloratingfixed(agon_data = nba, k = 100, init_elo = 1000)

To recreate the results from the 2016 manuscript, use the following code:

# Males, model type 1:
melo1 = eloratingopt(agon_data = chimpagg_m, pres_data = chimppres_m, fit_init_elo = F)

# Males, model type 3:
melo3 = eloratingopt(agon_data = chimpagg_m[101:nrow(chimpagg_m),], 
                     pres_data = chimppres_m, fit_init_elo = T)

# Females, model type 1: 
felo1 = eloratingopt(agon_data = chimpagg_f, pres_data = chimppres_f, fit_init_elo = F)

# Females, model type 3:
felo3 = eloratingopt(agon_data = chimpagg_f[101:nrow(chimpagg_f),], 
                     pres_data = chimppres_f, fit_init_elo = T)

elooptimized's People

Contributors

jtfeld avatar steffenfoerster avatar

Stargazers

 avatar  avatar

Watchers

 avatar

elooptimized's Issues

error with dates?

I run the eloratingopt and eloratingfixed functions in a dataset with the required format but keep on getting the following error message:

Error in eloratingopt(agon_data = Data, fit_init_elo = FALSE) :
some start dates are later than end dates. ID's with this problem:

any ideas?

Error executing function elo.m3_lik_vect

When executing the function elo.m3_lik_vect(par, IA_data, all_ids) happens the following error
"Error in par [1]:
   object of closure type can not be split into subsets"
could you advise me how to fix this?

Multiple matches on same day work around?

I tried entering a dataset that had a few teams play multiple matches on the same day and it appears to break the code as I changed some of the dates on the NBA dataset and got the same error. Is there any work around to get this to work without manually changing the dates or deleting the entries entirely?

Thanks, great package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.