GithubHelp home page GithubHelp logo

chess_vs_sleep's Introduction

Chess_vs_Sleep

A mini-experiment you can do on your own to see how often you win chess games, depending on whether you get an adequate amount of sleep.

image

My winning percentage on days when I had an adequate amount of sleep the day before versus when I did not.

You will need:

  • Data from Fitbit.com (You have to request your own data)
  • data from chess.com (You can download your username or another's)
  • This code, written in R

Background

I love chess as it's all completely logical. There's no luck, it's all strategy. A thought occurred to me: does the amount of sleep you get affect how well you play this tough mental challenge?

Setup

I downloaded some data from Fitbit to see how often I win compared to how much sleep I get. This looks at 613 days where I played at least two chess games. I didn't always have data from my fitbit though for days when I'm charging it overnight. So here we're looking at 389 days.

Analysis

I came up with this graph:

image

That is a big old nothing burger. Same for deep sleep, restlessness, etc. Very low R value of correlation. This surprised me but I'm always happy to be proven wrong by data.

Sometime later though I came back to this project as I realized sleep really isn't a continuous variable so much as a categorical one. Getting 30% more sleep doesn't mean you get a 30% increase in mental acuity, in the same way that 30% more sun might make a spot 30% hotter.

So I went back and looked at dates where I had definitely gotten enough sleep versus times when I definitely had too little.

I found there was a difference when you get enough sleep!

image

Overall I usually win about half of my games and lose half. Which is roughly how it should be: image

So to have a 2.5% increase is huge. Though keep in mind this is a very small section of my data. I defined "too little" sleep as less than 6 hours and enough as more than 8 hours.
image

Now It's Your turn

This isn't an official experiment. Obviously you can't draw conclusions from one person. But you can have a lot of fun with this. There's many additional things you could try here. For example, you could use data from more people, look at cumulative sleep debt over time, see how bedtime affects things, etc. Posting with a creative commons license. (Share/share alike) But definitely a very different distribution: image

chess_vs_sleep's People

Contributors

walinchus avatar

Watchers

 avatar

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.