CS 149: Understanding Stascs Using...

Post on 09-Jun-2020

0 views 0 download

Transcript of CS 149: Understanding Stascs Using...

CS 149: Understanding Sta2s2cs Using Baseball

Outline for today

Introduc)onsGooversyllabusThehistoryofsta)s)csinbaseballBaseballsta)s)csandstructureddata

Introduc2ons

Aboutyou:

•  Name•  Preferredgenderpronouns•  YearatHampshire:DivI,II-firstyear,II-secondyear,III•  Abitaboutyourbackground

•  E.g.experiencewithbaseball,programmingandSta)s)cs

•  Anythingelseyouwanttosay

Isthereanytopicyouarepar)cularlyinterestedin?i.e.,whyareyouinterestedinthisclass?

General Informa2on

Mycontactinfo: Email:emeyers@hampshire.edu

Phone:x5500 Office:ASH133Drop-inofficehours:

•  Monday2:30-3:30pm•  Tuesday12:30-1:30•  Byappointment

Website:hVps://moodle.hampshire.edu/course/view.php?id=5532

Course objec2ves

1.Tounderstandhowtousesta$s$calmethodsandthinkingtomakesenseofbaseballandothersystemsthatinvolverandomprocesses2.TobeabletousetheRprogramminglanguagetoanalyzedata

Note: sta2s2cs vs. Sta2s2cs

sta$s$cs:arenumericalsummariesofdata

Sta$s$cs:isthemathema)csofcollec)ng,organizingandinterpre)ngdata

Why use baseball to study Sta2s2cs?

Highdegreeofrandomness•  Verygoodplayershitsafely3outof10)mes(ave=.300)•  Badplayershitsafely2outof10)mes(ave=.200)

Containsarichstructurethatrepeats,whichmakesitpossibletoisolatecomponentsandanalyzethem

•  Discreteeventsmakesitrela)velyeasytoanalyze:•  Pitches->plateappearances->innings->games->seasons->$

Lotsofdataavailable•  Datagoingbackto1871

Overall:Excellentsystemtoprac)ceusingdatatoanswerrealques)ons

Background knowledge

Noprerequisites

Familiaritywiththebasicrulesofbaseballwillbeuseful• Wewillbrieflygoovertherulesandwatchaninningsofbaseballnextclass•  Wecanalsoarrangeaddi)onal)meforstudentswhowant

Required Textbooks

TeachingSta)s)csUsingBaseball(TSUB)BigDataBaseball(BDB)

Highly recommended textbook

AnalyzingBaseballDatawithR•  Availableasane-bookthroughHampshire

Other recommended books MoneyballTheSabermetricrevolu)on

Topics covered

Visualizingandexploringasinglebatchofdata

Comparingbatchesofdataandstandardiza)on

Rela)onshipsbetweenmeasuredvariables

Introduc)ontoprobability

Introduc)ontosta)s)calinference•  Hypothesistestsandconfidenceintervals

Ifthereis)me:•  Modelingbaseballgames•  Othersabermetrictopics

Types of ques2ons we will be trying to answer using sta2s2cs

Howmuchmorevaluableisahomeruncomparedtoasingle?

Whichsta)s)csbestcaptureabaseballplayersability•  i.e.,isonbasepercentageabeVermeasurethanbaVeraverage?

WhoisthebestbaseballhiVerofall)me?ArecertainbaseballplayersstreakyorclutchhiVers?DidtheTigersmakeagooddecisionsigningMiguelCabrerafor$292millionoverthenext8years?

Class assignments

1.WeeklyworksheetsthatinvolveRandotherproblems•  AssignedonThursdaysandtheyareduethefollowingSundayatmidnight

•  AlsoclassreadingsfromTeachingSta)s)csUsingBaseball

2.Weekly‘quoteandreac)ons’toBigDataBaseballchapter

3.One‘beVerknowaplayerpresenta)ons’(onMondays)•  5-10minutepresenta)onaboutabaseball/sokballplayer(oranothertopicrelatedtotheclass)

4.Afinalprojectwhereyouanalyzerelatedtobaseball(ortheclassmoregenerally)andwriteupa5-10pagepaperabouttheresults

5.Aclasspresenta)onaboutyourfinalproject

Policies

Veryimportanttoturnyourworkinon)me!•  Threestrikeslatepolicy•  Ifyouturninthreeassignmentslateyoudon’tgetanevalua)on

AVendclass

Youcanusealaptopfornotes,butobviouslydonotuseitforanythingnotrelatedtotheclass

CheckyourHampshireemailand/orsetupmailforwarding.IwillsendannouncementstoyourHampshireemailaccount

Policies

Incompleteswillonlybegivenoutinveryexcep)onalcircumstances

Specialneeds:pleaseletmeknowifyouhaveadisabilityorspecialneed.AlsoitwouldbeagoodtotalktoAaronFerguson–x5498

Academicdishonesty:youcanworkontheworksheetswithothersbuttheworkyouturninneedstobeyourown(i.e.,youneedtounderstandtheconcepts).

To make this class a success…

Ac)velyengagedintheclass•  Dothereadingsandjoininthediscussions

Communitylearningenvironment•  Shareinteres)ngthingsyou’velearned•  Iwanttolearnfromyoutoo

Followingyourinterests•  Icanadapttheclasstopeople’sinterests

Class survey

InorderformetogettoknowyouandtobeVeradjusttheclasstoyourinterests,pleasefilloutthesurvey

The history of baseball sta2s2cs

Early sta2s2cs HenryChadwick(1824-1908)createdthefirstboxescoreinthe1859issueofClipper.

•  FirsttouseKforstrikeout,saidtohaveinventedbaqngaverageandearnedrunaverage

•  DidnotrecordwalksbecausehedidnotfeeltheyreflectedabaVersskill

Classic sta2s2cs

Mostprominenthiqngsta)s)cs:•  Baqngaverage,RBIs,andhomeruns

Mostprominentpitchingsta)s)cs:• Wins,earnedrunaverage,strikeouts

Sabermetrics

Ques)onedhowusefultradi)onalmeasuresofperformance,suchasbaqngaverageorpitcherwinsSabermetricsdefini)ons:

1.Theempiricalormathema)cal/Sta)s)calstudyofbaseball2."thesearchforobjec)veknowledgeaboutbaseball”

-BillJames

Namecomesfrom‘SocietyforAmericanBaseballResearch’(SABR),agroupstartedin1971

•  Pre-computers,hadtocompileallinforma$onfromboxscoresbyhandsincetherewasnoencyclopediathathadgamebygamedata

Sabermetricsfirstwidelyintroducetothepublicin1982withthepublica)onofBillJamesBaseballAbstract

Baseball data sets

LahmanDatabase:Season-by-seasondata

RetrosheetGame-by-Gamedata

RetrosheetPlay-by-Playdata

PITCHf/x:Pitch-by-Pitchdata(loca)on,pitchtype)

A few prominent Sabermetric publica2ons/websites

SocietyforAmericanBaseballResearch

BillJamesOnline

BaseballAnalysts

BaseballProspectus

BeyondtheBoxScore

FanGraphs

TheHardballTimes

TangoTiger

Moneyball

StoryabouthowtheBillyBean,thegeneralmanageroftheA’s,wasabletoputtogetheratoprankedteamin2002ona)ghtbudgetbyfindingundervaluedplayersusingadvancedsta)s)cs

Someoftheclaimsofthebookmightbeexaggeratedbythebookhadabitimpactontheexpansionofmajorleagueclubsdoingadvanceddataanalyses.

Big Data Baseball

Morerecentsabermetricadvances•  2013PiVsburghPirates

Increasing analy2cs to gain an edge

hVp://online.wsj.com/news/ar)cle_email/baseballs-science-experiment-1411135882-lMyQjAxMTA0NzE3OTIxNDkwWj

Common baseball sta2s2cs

Let’slookatsomebaseballcards…

Structured data

Lahman Database – Individual player yearly baXng sta2s2cs

Cases

Variables

DatatakenfromtheLahmanBaqngdataset

Example Dataset – Individual player yearly sta2s2cs

Cases

Variables

Example Dataset – Individual player yearly sta2s2cs

Cases

Variables

Categorical and Quan2ta2ve Variables Cases

CategoricalVariable Quan)ta)veVariable

Explanatory and Response Variables

Some)mesweuseonevariable(theexplanatoryvariable)tounderstand/predictanothervariable(theresponsevariable)

Another Dataset – 2014 Team sta2s2cs Cases

Variables

Next class – examining a single batch of data

Filloutsurveyonline!(linkisonMoodle)Readchapter1ofBigDataBaseballandpostaquoteandreac)ontotheMoodleforumbymidnightonSundayReadchapter1ofTeachingSta)s)csUsingBaseball