{"id":62,"date":"2016-04-01T11:12:59","date_gmt":"2016-04-01T11:12:59","guid":{"rendered":"https:\/\/blogs.mathworks.com\/headlines\/?p=62"},"modified":"2018-09-14T14:38:09","modified_gmt":"2018-09-14T14:38:09","slug":"mlb-opening-day-matlab-data-and-baseball","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/headlines\/2016\/04\/01\/mlb-opening-day-matlab-data-and-baseball\/","title":{"rendered":"MLB Opening Day: MATLAB, Data and Baseball!"},"content":{"rendered":"<p>It&#8217;s that time of year again. Baseball season gets underway this weekend. Ever since the book\u00a0<a href=\"http:\/\/www.amazon.com\/Moneyball-The-Winning-Unfair-Game-ebook\/dp\/B000RH0C8G?ie=UTF8&amp;keywords=moneyball&amp;qid=1459184622&amp;ref_=sr_1_1&amp;s=books&amp;sr=1-1\" target=\"_blank\" rel=\"noopener\"><em><span id=\"ebooksProductTitle\" class=\"a-size-extra-large\">Moneyball: The Art of Winning an Unfair Game<\/span><\/em><\/a>\u00a0was published in 2004, there has been an increased focus on data analysis\u00a0in this sport.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-71\" src=\"https:\/\/blogs.mathworks.com\/headlines\/files\/feature_image\/baseball_450x300.jpg\" alt=\"baseball_450x300\" width=\"279\" height=\"186\" \/><\/p>\n<p>Engineers, engineering students, and mathematically-inclined baseball enthusiasts have used <a href=\"https:\/\/www.mathworks.com\/products\/statistics\/\" target=\"_blank\" rel=\"noopener\">MATLAB <\/a>in a number of baseball-related studies, from <a title=\"https:\/\/www.wpi.edu\/Pubs\/E-project\/Available\/E-project-042811-102638\/unrestricted\/MQP_4-28-11docx[1].pdf (link no longer works)\" target=\"_blank\" rel=\"noopener\">finding the sweet spot on a bat<\/a>, to\u00a0determining the <a href=\"http:\/\/www.fangraphs.com\/community\/where-to-bat-your-best-hitter-a-computational-analysis-part-1\/\" target=\"_blank\" rel=\"noopener\">best spot in a line-up<\/a> for the top hitters. MATLAB has also been used to\u00a0<a href=\"http:\/\/repository.usfca.edu\/cgi\/viewcontent.cgi?article=1000&amp;context=msan_fac\" target=\"_blank\" rel=\"noopener\">predict the success of a team<\/a>, similar to the approach seen in <a href=\"http:\/\/www.sonypictures.com\/movies\/moneyball\/\" target=\"_blank\" rel=\"noopener\">Moneyball<\/a>.<\/p>\n<h2><strong>Combining MATLAB with Baseball Data<\/strong><\/h2>\n<p>With the increased availability of\u00a0sensor technology for sports measurements, it\u2019s no wonder we see mathematicians and engineers combining MATLAB with baseball. Sensors generate data\u2026 <a href=\"https:\/\/www.mathworks.com\/solutions\/data-analysis.html?s_tid=srchtitle\" target=\"_blank\" rel=\"noopener\">lots of data.<\/a>\u00a0There are a number of ways MATLAB has been used to analyze the resulting baseball data.<\/p>\n<ul>\n<li>Bryan Cole,\u00a0featured writer for Beyond the Box Score,\u00a0used MATLAB to quantify a relationship between consistency and hitter quality,\u00a0measuring over 1,500 individual swings from 25 hitters. His\u00a0goal was to enable young hitters to better measure their progress, and to provide a scouting tool for scouts and coaches to judge prospective players.<br \/>\n<span style=\"color: #005695;\"><br \/>\n<strong>\u201cTechnological developments, including inertial bat sensors and camera-based ball tracking systems, should make it possible to develop a quantitative measure of consistency readily available to a wider range of players, with a wider range of abilities,&#8221; according to Bryan Cole.<\/strong><br \/>\n<\/span><\/li>\n<\/ul>\n<ul>\n<li>A\u00a0project at MIT\u00a0was designed to\u00a0answer a specific baseball related question:\u00a0When is stealing second base a beneficial move for the offense?<strong>\u00a0<\/strong>For this project, MATLAB\u00a0was used\u00a0to simulate a large set\u00a0of possible outcomes.<br \/>\n<span style=\"color: #005695;\"><span style=\"color: #005695;\"><br \/>\n<strong>\u201cI constructed a baseball game simulator in MATLAB. After verifying its accuracy to real-life MLB statistics, I simulated millions of baseball games to test the effects of different stolen base strategy to answer the question,\u201d said David Hesslink, MIT student investigator.<\/strong><\/span><\/span><\/li>\n<\/ul>\n<ul>\n<li><a href=\"https:\/\/www.mathworks.com\/products\/deep-learning.html\" target=\"_blank\" rel=\"noopener\">Neural networks<\/a>\u00a0can be employed analyze\u00a0large sets of baseball data. \u00a0A\u00a0neural network be trained to find solutions, recognize patterns, classify data and forecast future events.\u00a0Bryan Cole used\u00a0MATLAB to build two artificial neural networks\u00a0to\u00a0determine if <a href=\"http:\/\/www.beyondtheboxscore.com\/2014\/12\/4\/7330177\/pitch-types-strike-zone-effects-pitchfx\" target=\"_blank\" rel=\"noopener\">umpires call strikes differently for different pitch types<\/a>.\u00a0The first used only the pitch&#8217;s location when it crossed the plate. The second included parameters related to break and movement\u00a0as well as end speed. He notes an advantage to neural networks is that <a href=\"https:\/\/www.mathworks.com\/help\/nnet\/ug\/train-neural-networks-with-error-weights-1.html?s_tid=srchtitle\" target=\"_blank\" rel=\"noopener\">weights can be used<\/a> to determine the\u00a0relative importance of each feature.The conclusion? Pitch type had minimal impact on strike zone.<\/li>\n<\/ul>\n<p>Last\u00a0month, the <a href=\"https:\/\/www.washingtonpost.com\/news\/fancy-stats\/wp\/2016\/03\/07\/the-perfect-storm-that-created-baseballs-biggest-home-run-surge-since-the-steroid-era\/\" target=\"_blank\" rel=\"noopener\">Washington Post <\/a>ran an article on the 2015 home run totals, calling it the \u201cbiggest home run surge since the steroids era\u201d. The number of MLB home runs jumped by over 17% in the past season, the largest spike since 1996.<\/p>\n<p>The\u00a0Washington Post\u00a0turned to Robert Vanderbei, a math professor at Princeton, to examine the odds of the offensive surge. Vanderbei used <a href=\"https:\/\/www.mathworks.com\/products\/matlab\/\" target=\"_blank\" rel=\"noopener\">MATLAB <\/a>to determine the odds of a 17% increase\u00a0after downward trends in 2013 and 2014.\u00a0What did his calculations find\u00a0were\u00a0the odds of such a\u00a0spike?<\/p>\n<p><strong><span style=\"color: #005695;\">\u201cIt said\u00a0zero,\u201d Vanderbei said. \u201cSomething definitely changed. I don\u2019t know what, but something definitely, significantly changed.\u201d<\/span><\/strong><\/p>\n<p>In that\u00a0Washington Post article, a MLB executive<strong> <a href=\"https:\/\/www.washingtonpost.com\/news\/fancy-stats\/wp\/2016\/03\/07\/the-perfect-storm-that-created-baseballs-biggest-home-run-surge-since-the-steroid-era\/\" target=\"_blank\" rel=\"noopener\">credited the spike to data analysis:<\/a><\/strong><\/p>\n<p style=\"padding-left: 30px;\"><strong><span style=\"color: #005695;\">\u201cTeams are smarter, <span style=\"text-decoration: underline;\"><em>more information<\/em><\/span> is available and there are philosophical shifts happening all over baseball. We have the <span style=\"text-decoration: underline;\"><em>tools to analyze<\/em><\/span> everything and we are valuing things differently.<\/span>\u201d<\/strong><\/p>\n<h2 style=\"text-align: center;\"><strong>More information = data<\/strong><\/h2>\n<h2 style=\"text-align: center;\"><strong>Tools to analyze = MATLAB<\/strong><\/h2>\n<p>Could MATLAB-based research and data analysis be responsible for the home run spike? It is possible! \u00a0Leave a comment if you\u2019ve worked on a baseball-related project with MATLAB.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/headlines\/files\/feature_image\/baseball_450x300.jpg\" onError=\"this.style.display ='none';\" \/><\/div>\n<p>It&#8217;s that time of year again. Baseball season gets underway this weekend. Ever since the book\u00a0Moneyball: The Art of Winning an Unfair Game\u00a0was published in 2004, there has been an increased&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/headlines\/2016\/04\/01\/mlb-opening-day-matlab-data-and-baseball\/\">read more >><\/a><\/p>\n","protected":false},"author":138,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/headlines\/wp-json\/wp\/v2\/posts\/62"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/headlines\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/headlines\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/headlines\/wp-json\/wp\/v2\/users\/138"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/headlines\/wp-json\/wp\/v2\/comments?post=62"}],"version-history":[{"count":8,"href":"https:\/\/blogs.mathworks.com\/headlines\/wp-json\/wp\/v2\/posts\/62\/revisions"}],"predecessor-version":[{"id":1881,"href":"https:\/\/blogs.mathworks.com\/headlines\/wp-json\/wp\/v2\/posts\/62\/revisions\/1881"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/headlines\/wp-json\/wp\/v2\/media?parent=62"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/headlines\/wp-json\/wp\/v2\/categories?post=62"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/headlines\/wp-json\/wp\/v2\/tags?post=62"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}