{"id":6457,"date":"2020-11-06T15:49:53","date_gmt":"2020-11-06T20:49:53","guid":{"rendered":"https:\/\/blogs.mathworks.com\/cleve\/?p=6457"},"modified":"2020-11-06T15:49:53","modified_gmt":"2020-11-06T20:49:53","slug":"anticipating-official-u-s-census-for-2020","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/cleve\/2020\/11\/06\/anticipating-official-u-s-census-for-2020\/","title":{"rendered":"Anticipating Official U.S. Census for 2020"},"content":{"rendered":"<div class=\"content\"><!--introduction--><p>On October 13, the U.S. Supreme Court ruled that the U.S. Census Bureau could stop the 2020 census early. Here is a link to just one of many recent news articles about the census, <a href=\"https:\/\/www.nytimes.com\/article\/census-supreme-court-ruling.html\">New York Times<\/a>.<\/p><p>I like to use data from the U.S. census as an example for curve fitting. Three years ago, I wrote about the census in <a href=\"https:\/\/www.mathworks.com\/company\/newsletters\/articles\/fitting-and-extrapolating-u-s-census-data.html\">MathWorks News &amp; Notes<\/a> and in <a href=\"https:\/\/blogs.mathworks.com\/cleve\/2017\/01\/05\/fitting-and-extrapolating-us-census-data\/\">this blog<\/a>. It's time for an update.<\/p><!--\/introduction--><h3>Contents<\/h3><div><ul><li><a href=\"#1745cf03-a7fd-43d2-8165-1ee54a2035be\">1900-2010<\/a><\/li><li><a href=\"#899106ad-7bd8-4ff0-b882-8bab8b1c4cce\">2020<\/a><\/li><li><a href=\"#5509ddc4-6b3b-4106-9484-5cc8c96750c2\">makima<\/a><\/li><li><a href=\"#c3985be5-8973-48ec-89ac-5c2b9d88b411\">pop clock<\/a><\/li><li><a href=\"#dbe87e5f-99f7-4ff7-a59e-1f760721cc7e\">2030<\/a><\/li><\/ul><\/div><h4>1900-2010<a name=\"1745cf03-a7fd-43d2-8165-1ee54a2035be\"><\/a><\/h4><p>We begin with twelve data points, the U.S. Census counts every ten years between 1900 to 2010.  The units are millions of people.<\/p><pre>   1900    75.995\r\n   1910    91.972\r\n   1920   105.711\r\n   1930   123.203\r\n   1940   131.669\r\n   1950   150.697\r\n   1960   179.323\r\n   1970   203.212\r\n   1980   226.505\r\n   1990   249.633\r\n   2000   281.422\r\n   2010   308.746<\/pre><h4>2020<a name=\"899106ad-7bd8-4ff0-b882-8bab8b1c4cce\"><\/a><\/h4><p>One of the experiments in Cleve's Laboratory is <tt>censusapp<\/tt>. Recent versions have invited you to extrapolate to 2020. A dozen of the fits, including high degree polynomials, fail spectacularly with extrapolation.  Only five models provide reasonable predictions of the count in 2020.<\/p><pre>  quadratic  342.047\r\n  cubic      341.125\r\n  quartic    332.066\r\n  pchip      331.268\r\n  logistic   339.595<\/pre><h4>makima<a name=\"5509ddc4-6b3b-4106-9484-5cc8c96750c2\"><\/a><\/h4><p>A few years ago we introduced a third cubic spline, <tt>makima<\/tt>, in MATLAB.  My colleague Cosmin Ionita wrote about <tt>makima<\/tt> in <a href=\"https:\/\/blogs.mathworks.com\/cleve\/2019\/04\/29\/makima-piecewise-cubic-interpolation\/\">this blog post<\/a>. The model is a modification of work from 1970 by Hiroshi Akima. The three splines, <tt>spline<\/tt>, <tt>pchip<\/tt> and <tt>makima<\/tt>, primarily differ in the way they handle the tradeoff between smoothness and oscillations. Two of them, <tt>spline<\/tt> and <tt>makima<\/tt>, generalize to many dimensions, while <tt>pchip<\/tt> does not.<\/p><p>The three splines also have different ways of handling conditions at the ends of the interval.  This is key when we use them for extrapolation. Good behavior outside the interval is not any spline's strength, but for the census data <tt>makima<\/tt> gets lucky.  So, add this line to the five above.<\/p><pre>  makima     329.810<\/pre><h4>pop clock<a name=\"c3985be5-8973-48ec-89ac-5c2b9d88b411\"><\/a><\/h4><p>There is no reason to believe that populations behave like cubic polynomials in time.  The U.S. Census Bureau has a more realistic model.  Their model drives the population clock available at their web site, <a href=\"https:\/\/www.census.gov\/popclock\">popclock<\/a>.<\/p><p>The U.S. population is now growing at a rate of roughly 1.6 million people per year. Theoretically, the census measures the population on April 1 of a particular year. At the bottom of the first window of <a href=\"https:\/\/www.census.gov\/popclock\">popclock<\/a> is a clickable link with a tiny calendar labelled \"Select a Date\". Go back to April 1, 2020.  The model says the population on that date was<\/p><pre>  popclock   329.459<\/pre><p>This is not yet the official value that will be produced by the 2020 census.  For that, we have to wait for an announcement.<\/p><p>All of our models overestimate the <tt>popclock<\/tt> value. Surprisingly, <tt>makima<\/tt> happens to be closest. My post and newsletter article three years ago began by citing a headline in the New York Times, \"Growth of U.S. Population Is at Slowest Pace Since 1937\". None of our models have any notion of this trend. The end point conditions in <tt>pchip<\/tt> and <tt>makima<\/tt> produce cubics that are used for extrapolation.  These cubics have a negative second derivative and so their growth rate is also slowed.<\/p><h4>2030<a name=\"dbe87e5f-99f7-4ff7-a59e-1f760721cc7e\"><\/a><\/h4><p>An interesting note available from <a href=\"https:\/\/www.census.gov\/content\/dam\/Census\/library\/publications\/2020\/demo\/p25-1144.pdf\">the U.S. Census Bureau<\/a> points out that \"the year 2030 marks a demographic turning point for the United States. Beginning that year, all baby boomers will be older than 65.\"<\/p><p>I have added the <tt>popclock<\/tt> value to the data used by <tt>censusapp<\/tt> and now suggest extrapolation to 2030.  The code is included in the version of Cleve's Laboratory that is now available from <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/59085-cleve_lab\">MATLAB Central File Exchange<\/a>.  All three splines paint a gloomy picture for 2030.  Perhaps the extrapolation by the fifth degree polynomial seen in this <tt>censusapp<\/tt> screen shot will turn out to be prophetic.<\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"http:\/\/blogs.mathworks.com\/cleve\/files\/census2030.png\" alt=\"\"> <\/p><script language=\"JavaScript\"> <!-- \r\n    function grabCode_4e843145a63743b68736cb1e090e964d() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='4e843145a63743b68736cb1e090e964d ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 4e843145a63743b68736cb1e090e964d';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        copyright = 'Copyright 2020 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n\r\n        d.title = title + ' (MATLAB code)';\r\n        d.close();\r\n    }   \r\n     --> <\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_4e843145a63743b68736cb1e090e964d()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n      the MATLAB code <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; R2020b<br><\/p><\/div><!--\r\n4e843145a63743b68736cb1e090e964d ##### SOURCE BEGIN #####\r\n%% Anticipating Official U.S. Census for 2020 \r\n% On October 13, the U.S. Supreme Court ruled that the\r\n% U.S. Census Bureau could stop the 2020 census early.\r\n% Here is a link to just one of many recent news articles about\r\n% the census,\r\n% <https:\/\/www.nytimes.com\/article\/census-supreme-court-ruling.html\r\n% New York Times>.\r\n%\r\n% I like to use data from the U.S. census as an example for curve fitting.\r\n% Three years ago, I wrote about the census in\r\n% <https:\/\/www.mathworks.com\/company\/newsletters\/articles\/fitting-and-extrapolating-u-s-census-data.html\r\n% MathWorks News & Notes> and in\r\n% <https:\/\/blogs.mathworks.com\/cleve\/2017\/01\/05\/fitting-and-extrapolating-us-census-data\/\r\n% this blog>.\r\n% It's time for an update.\r\n\r\n%% 1900-2010\r\n% We begin with twelve data points, the U.S. Census counts every ten years\r\n% between 1900 to 2010.  The units are millions of people.\r\n%\r\n%     1900    75.995\r\n%     1910    91.972  \r\n%     1920   105.711\r\n%     1930   123.203\r\n%     1940   131.669\r\n%     1950   150.697\r\n%     1960   179.323\r\n%     1970   203.212\r\n%     1980   226.505\r\n%     1990   249.633\r\n%     2000   281.422\r\n%     2010   308.746\r\n\r\n%%  2020\r\n% One of the experiments in Cleve's Laboratory is |censusapp|.\r\n% Recent versions have invited you to extrapolate\r\n% to 2020.\r\n% A dozen of the fits, including high degree polynomials,\r\n% fail spectacularly with extrapolation.  Only five models provide\r\n% reasonable predictions of the count in 2020.\r\n%\r\n%    quadratic  342.047\r\n%    cubic      341.125\r\n%    quartic    332.066\r\n%    pchip      331.268\r\n%    logistic   339.595\r\n\r\n%% makima\r\n% A few years ago we introduced a third cubic spline, |makima|,\r\n% in MATLAB.  My colleague Cosmin Ionita wrote about |makima| in\r\n% <https:\/\/blogs.mathworks.com\/cleve\/2019\/04\/29\/makima-piecewise-cubic-interpolation\/\r\n% this blog post>.  \r\n% The model is a modification of work from 1970 by Hiroshi Akima.\r\n% The three splines, |spline|, |pchip| and |makima|, primarily differ in\r\n% the way they handle the tradeoff between smoothness and oscillations.\r\n% Two of them, |spline| and |makima|, generalize to many dimensions,\r\n% while |pchip| does not.\r\n%\r\n% The three splines also have different ways of handling conditions at the\r\n% ends of the interval.  This is key when we use them for extrapolation.\r\n% Good behavior outside the interval is not any spline's strength,\r\n% but for the census data |makima| gets lucky.  So, add this line to the\r\n% five above.\r\n%\r\n%    makima     329.810\r\n\r\n%% pop clock\r\n% There is no reason to believe that populations behave like\r\n% cubic polynomials in time.  The U.S. Census Bureau has a more realistic\r\n% model.  Their model drives the population clock\r\n% available at their web site,\r\n% <https:\/\/www.census.gov\/popclock popclock>.\r\n%\r\n% The U.S. population is now growing at a rate of roughly 1.6 million\r\n% people per year.\r\n% Theoretically, the census measures the population on April 1 of a\r\n% particular year.\r\n% At the bottom of the first window of\r\n% <https:\/\/www.census.gov\/popclock popclock>\r\n% is a clickable link with a tiny calendar labelled \"Select a Date\".\r\n% Go back to April 1, 2020.  The model says the population on that date was\r\n%\r\n%    popclock   329.459\r\n%\r\n% This is not yet the official value that will be produced by the\r\n% 2020 census.  For that, we have to wait for an announcement.\r\n%\r\n% All of our models overestimate the |popclock| value.\r\n% Surprisingly, |makima| happens to be closest.\r\n% My post and newsletter article three years ago began by citing\r\n% a headline in the New York Times,\r\n% \"Growth of U.S. Population Is at Slowest Pace Since 1937\".\r\n% None of our models have any notion of this trend.\r\n% The end point conditions in |pchip| and |makima| produce cubics\r\n% that are used for extrapolation.  These cubics have a negative\r\n% second derivative and so their growth rate is also slowed. \r\n\r\n%% 2030\r\n% An interesting note available from\r\n% <https:\/\/www.census.gov\/content\/dam\/Census\/library\/publications\/2020\/demo\/p25-1144.pdf\r\n% the U.S. Census Bureau> points out that \r\n% \"the year 2030 marks a demographic turning point for the United States.\r\n% Beginning that year, all baby boomers will be older than 65.\"\r\n%\r\n% I have added the |popclock| value to the data used by |censusapp|\r\n% and now suggest extrapolation to 2030.  The code is included in\r\n% the version of Cleve's Laboratory that is now available from\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/59085-cleve_lab\r\n% MATLAB Central File Exchange>.  All three splines paint a gloomy\r\n% picture for 2030.  Perhaps the extrapolation by the fifth degree\r\n% polynomial seen in this |censusapp| screen shot \r\n% will turn out to be prophetic.\r\n%\r\n% <<census2030.png>>\r\n\r\n\r\n##### SOURCE END ##### 4e843145a63743b68736cb1e090e964d\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"http:\/\/blogs.mathworks.com\/cleve\/files\/census2030.png\" onError=\"this.style.display ='none';\" \/><\/div><!--introduction--><p>On October 13, the U.S. Supreme Court ruled that the U.S. Census Bureau could stop the 2020 census early. Here is a link to just one of many recent news articles about the census, <a href=\"https:\/\/www.nytimes.com\/article\/census-supreme-court-ruling.html\">New York Times<\/a>.... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/cleve\/2020\/11\/06\/anticipating-official-u-s-census-for-2020\/\">read more >><\/a><\/p>","protected":false},"author":78,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts\/6457"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/users\/78"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/comments?post=6457"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts\/6457\/revisions"}],"predecessor-version":[{"id":6459,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts\/6457\/revisions\/6459"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/media?parent=6457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/categories?post=6457"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/tags?post=6457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}