speice.io/assets/js/b08f0f32.ca470981.js

1 line
39 KiB
JavaScript
Raw Normal View History

"use strict";(self.webpackChunkspeice_io=self.webpackChunkspeice_io||[]).push([["9363"],{11998:function(e,s,a){a.r(s),a.d(s,{assets:function(){return h},contentTitle:function(){return l},default:function(){return d},frontMatter:function(){return r},metadata:function(){return t},toc:function(){return m}});var t=a(4315),n=a(85893),i=a(50065);let r={slug:"2016/04/tick-tock",title:"Tick tock...",date:new Date("2016-04-06T12:00:00.000Z"),authors:["bspeice"],tags:[]},l=void 0,h={authorsImageUrls:[void 0]},m=[{value:"2.5 Billion",id:"25-billion",level:2},{value:"Statistical Considerations",id:"statistical-considerations",level:2},{value:"Getting the data",id:"getting-the-data",level:2},{value:"Registering an application",id:"registering-an-application",level:2},{value:"Handling OAuth 2",id:"handling-oauth-2",level:3},{value:"Requesting the data",id:"requesting-the-data",level:3},{value:"Wild Extrapolations from Small Data",id:"wild-extrapolations-from-small-data",level:2},{value:"How many heartbeats so far?",id:"how-many-heartbeats-so-far",level:3},{value:"How many heartbeats longer?",id:"how-many-heartbeats-longer",level:3},{value:"Summary",id:"summary",level:2}];function c(e){let s={a:"a",annotation:"annotation",code:"code",h2:"h2",h3:"h3",li:"li",math:"math",mi:"mi",mo:"mo",mrow:"mrow",mstyle:"mstyle",msub:"msub",mtable:"mtable",mtd:"mtd",mtr:"mtr",ol:"ol",p:"p",pre:"pre",semantics:"semantics",span:"span",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.p,{children:"If all we have is a finite number of heartbeats left, what about me?"}),"\n",(0,n.jsx)(s.p,{children:"Warning: this one is a bit creepier. But that's what you get when you come up with data science ideas as you're drifting off to sleep."}),"\n",(0,n.jsx)(s.h2,{id:"25-billion",children:"2.5 Billion"}),"\n",(0,n.jsxs)(s.p,{children:["If ",(0,n.jsx)(s.a,{href:"http://www.pbs.org/wgbh/nova/heart/heartfacts.html",children:"PBS"})," is right, that's the total number of heartbeats we get. Approximately once every second that number goes down, and down, and down again..."]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-python",children:"total_heartbeats = 2500000000\n"})}),"\n",(0,n.jsx)(s.p,{children:"I got a Fitbit this past Christmas season, mostly because I was interested in the data and trying to work on some data science projects with it. This is going to be the first project, but there will likely be more (and not nearly as morbid). My idea was: If this is the final number that I'm running up against, how far have I come, and how far am I likely to go? I've currently had about 3 months' time to estimate what my data will look like, so let's go ahead and see: given a lifetime 2.5 billion heart beats, how much time do I have left?"}),"\n",(0,n.jsx)(s.h2,{id:"statistical-considerations",children:"Statistical Considerations"}),"\n",(0,n.jsx)(s.p,{children:"Since I'm starting to work with health data, there are a few considerations I think are important before I start digging through my data."}),"\n",(0,n.jsxs)(s.ol,{children:["\n",(0,n.jsxs)(s.li,{children:["The concept of 2.5 billion as an agreed-upon number is tenuous at best. I've seen anywhere from ",(0,n.jsx)(s.a,{href:"http://gizmodo.com/5982977/how-many-heartbeats-does-each-species-get-in-a-lifetime",children:"2.21 billion"})," to ",(0,n.jsx)(s.a,{href:"http://wonderopolis.org/wonder/how-many-times-does-your-heart-beat-in-a-lifetime/",children:"3.4 billion"})," so even if I knew exactly how many times my heart had beaten so far, the ending result is suspect at best. I'm using 2.5 billion because that seems to be about the midpoint of the estimates I've seen so far."]}),"\n",(0,n.jsx)(s.li,{children:"Most of the numbers I've seen so far are based on extrapolating number of heart beats from life expectancy. As life expectancy goes up, the number of expected heart beats goes up too."}),"\n",(0,n.jsx)(s.li,{children:"My estimation of the number of heartbeats in my life so far is based on 3 months worth of data, and I'm extrapolating an