{"id":295,"date":"2017-10-18T14:12:46","date_gmt":"2017-10-18T14:12:46","guid":{"rendered":"http:\/\/blogs.reading.ac.uk\/dare\/?p=295"},"modified":"2022-05-11T15:52:12","modified_gmt":"2022-05-11T14:52:12","slug":"whats-in-a-number","status":"publish","type":"post","link":"https:\/\/research.reading.ac.uk\/dare\/2017\/10\/18\/whats-in-a-number\/","title":{"rendered":"What\u2019s in a number?"},"content":{"rendered":"<p>By Nancy Nichols<\/p>\n<p>Should you care about the numerical accuracy of your computer?\u00a0 After all, most machines now retain about 16 digits of accuracy, but usually only about 3 &#8211; 4 figures of accuracy are needed for most applications; \u00a0so what\u2019s the worry?\u00a0\u00a0 To demonstrate, there have been a number of spectacular disasters due to numerical rounding error.\u00a0 One of the most well known is the failure of a Patriot Missile to track and intercept an Iraqi Scud missile in Dharan, Saudi Arabia, on February 25, 1991, resulting in the deaths of 28 American soldiers.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-300 alignleft\" src=\"https:\/\/research.reading.ac.uk\/dare\/wp-content\/uploads\/sites\/5\/2017\/09\/Nichols-3.jpg\" alt=\"\" width=\"416\" height=\"306\" \/><\/p>\n<p>The failure was ultimately attributable to poor handling of \u00a0rounding errors.\u00a0 The computer doing the tracking calculations had an internal clock whose values were truncated when converted to floating-point arithmetic with an error of about 2<sup>-20 <\/sup>.\u00a0\u00a0 The clock had run up a time of 100 hours, so the calculated elapsed time was too long by 2<sup>-20<\/sup> x 100 hours = 0.3433 seconds, during which time a Scud would be expected to travel more than half a kilometer.<\/p>\n<p>&nbsp;<\/p>\n<p>(See The Patriot Missile Failure)<\/p>\n<p>The same problem arises in other algorithms that accumulate and magnify small round-off errors due to the finite (inexact) representation of numbers in the computer. \u00a0\u00a0Algorithms of this kind are referred to as \u2018unstable\u2019 methods.\u00a0 Many numerical schemes for solving differential equations have been shown to magnify small numerical errors.\u00a0 It is known, for example, that L.F. Richardson\u2019s original attempts at numerical weather forecasting were essentially scuppered due the unstable methods that were used to compute the atmospheric flow.\u00a0 \u00a0Much time and effort have now been invested in developing and carefully coding methods for solving algebraic and differential equations such as to guarantee stability.\u00a0\u00a0 Excellent software is publicly available.\u00a0 Academics and operational weather forecasting centres in the UK have been at the forefront of this research.<\/p>\n<p>Even with stable algorithms, however, it may not be possible to compute an accurate solution to a given problem.\u00a0\u00a0 The reason is that the solution may be sensitive to small errors\u00a0 &#8211;\u00a0 that is, a small error in the data describing the problem causes large changes in the solution.\u00a0 Such problems are called \u2018ill-conditioned\u2019.\u00a0\u00a0 Even entering the data of a problem into a computer\u00a0 &#8211; \u00a0for example, the initial conditions for a differential equation or the matrix elements of an eigenvalue problem\u00a0 &#8211;\u00a0 \u00a0must introduce small numerical errors in the data.\u00a0 If the problem is ill-conditioned, these then lead to large changes in the computed solution, which no method can prevent.<\/p>\n<p>So how do you know if your problem is sensitive to small perturbations in the data?\u00a0 Careful analysis can reveal the issue, but for some classes of problems there are measures of the sensitivity, or the \u2018conditioning\u2019, of the problem that can be used.\u00a0\u00a0 For example, it can be shown that small perturbations in a matrix can lead to large relative changes in the inverse of the matrix if the \u2018condition number\u2019 of the matrix is large.\u00a0 The condition number is measured as the product of the norm of the matrix and the norm of its inverse.\u00a0 Similarly\u00a0 small changes in the elements of a matrix will cause its eigenvalues to have large errors if the \u2018condition number\u2019 of the matrix of eigenvectors is large.\u00a0\u00a0 Of course to determine the condition numbers is a problem implicitly, but accurate computational methods for estimating the condition numbers are available .<\/p>\n<p>An example of an ill-conditioned matrix is the covariance matrix associated with a Gaussian distribution.\u00a0\u00a0 The following figure shows the condition number of a covariance matrix obtained by taking samples from a Gaussian correlation function at 500 points, using a step size of 0.1, for varying length-scales [1].<img loading=\"lazy\" decoding=\"async\" class=\"wp-image-296 aligncenter\" src=\"https:\/\/research.reading.ac.uk\/dare\/wp-content\/uploads\/sites\/5\/2017\/09\/Nichols.png\" alt=\"\" width=\"385\" height=\"304\" srcset=\"https:\/\/research.reading.ac.uk\/dare\/wp-content\/uploads\/sites\/5\/2017\/09\/Nichols.png 530w, https:\/\/research.reading.ac.uk\/dare\/wp-content\/uploads\/sites\/5\/2017\/09\/Nichols-300x237.png 300w\" sizes=\"auto, (max-width: 385px) 100vw, 385px\" \/>The condition number increases rapidly to 10<sup>7<\/sup> for length-scales of only size \u00a0L = 0.2\u00a0 and, for length scales larger than 0.28, the condition number is larger than the computer precision and cannot even be calculated accurately.<\/p>\n<p>This result is surprising and very significant for numerical weather prediction (NWP) as the inverse of covariance matrices are used to weight the uncertainty in the model forecast and in the observations used in the analysis phase of weather prediction.\u00a0 The analysis is achieved by the process of data assimilation, which combines a forecast from a computational model of the atmosphere with physical observations obtained from in situ and remote sensing instruments.\u00a0 If the weighting matrices are ill-conditioned, then the assimilation problem becomes ill-conditioned also, making it difficult to get an accurate analysis and subsequently a good forecast [2].\u00a0 Furthermore, the worse the conditioning of the assimilation problem becomes, the more time it takes to do the analysis. This is important as the forecast needs to be done in \u2018real\u2019 time, so the analysis needs to be done as quickly as possible.<\/p>\n<p>One way to deal with an ill-conditioned system is to rearrange the problem to so as to reduce the conditioning whilst retaining the same solution.\u00a0 A technique for achieving this is to \u2018precondition\u2019 the problem using a transformation of the variables.\u00a0 This is used regularly in NWP operational centres with the aim of ensuring that the uncertainties in the transformed variables all have a variance of one [1][2].\u00a0 In this table we can see the effects of the length-scale of the error correlations in a data assimilation system <img loading=\"lazy\" decoding=\"async\" class=\" wp-image-297 aligncenter\" src=\"https:\/\/research.reading.ac.uk\/dare\/wp-content\/uploads\/sites\/5\/2017\/09\/Nichols-2.png\" alt=\"\" width=\"401\" height=\"196\" srcset=\"https:\/\/research.reading.ac.uk\/dare\/wp-content\/uploads\/sites\/5\/2017\/09\/Nichols-2.png 574w, https:\/\/research.reading.ac.uk\/dare\/wp-content\/uploads\/sites\/5\/2017\/09\/Nichols-2-300x147.png 300w\" sizes=\"auto, (max-width: 401px) 100vw, 401px\" \/> on the number of iterations it takes to solve the problem, with and without preconditioning of the problem [1].\u00a0 The conditioning of the problem is improved and the work needed to solve the problem is significantly reduced. \u00a0So checking and controlling the conditioning of a computational problem is always important!<\/p>\n<p>[1]\u00a0 S.A Haben. 2011. Conditioning and Preconditioning of the Minimisation Problem in<\/p>\n<p>Variational Data Assimilation, University of Reading, Department of Mathematics and Statistics, <a href=\"https:\/\/www.reading.ac.uk\/maths-and-stats\/-\/media\/project\/uor-main\/schools-departments\/maths\/documents\/habenthesis.pdf?la=en&amp;hash=0C813956DC4FF2F7EFA63436594F181A\">Haben PhD Thesis<\/a><\/p>\n<p>[2]\u00a0 S.A. Haben, A.S. Lawless and N.K. Nichols.\u00a0 2011. Conditioning of incremental variational data assimilation, with application to the Met Office system, <em>Tellus<\/em>, 63A, 782\u2013792. (doi:10.1111\/j.1600-0870.2011.00527.x)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By Nancy Nichols Should you care about the numerical accuracy of your computer?\u00a0 After all, most machines now retain about 16 digits of accuracy, but usually only about 3 &#8211;&#8230;<a class=\"read-more\" href=\"&#104;&#116;&#116;&#112;&#115;&#58;&#47;&#47;&#114;&#101;&#115;&#101;&#97;&#114;&#99;&#104;&#46;&#114;&#101;&#97;&#100;&#105;&#110;&#103;&#46;&#97;&#99;&#46;&#117;&#107;&#47;&#100;&#97;&#114;&#101;&#47;&#50;&#48;&#49;&#55;&#47;&#49;&#48;&#47;&#49;&#56;&#47;&#119;&#104;&#97;&#116;&#115;&#45;&#105;&#110;&#45;&#97;&#45;&#110;&#117;&#109;&#98;&#101;&#114;&#47;\">Read More ><\/a><\/p>\n","protected":false},"author":20,"featured_media":300,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"image","meta":{"_acf_changed":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"__cvm_playback_settings":[],"__cvm_video_id":"","footnotes":"","_links_to":"","_links_to_target":""},"categories":[8],"tags":[],"class_list":["post-295","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-uncategorized","post_format-post-format-image"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.8.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What\u2019s in a number? - DARE<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/research.reading.ac.uk\/dare\/2017\/10\/18\/whats-in-a-number\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What\u2019s in a number? - DARE\" \/>\n<meta property=\"og:description\" content=\"By Nancy Nichols Should you care about the numerical accuracy of your computer?\u00a0 After all, most machines now retain about 16 digits of accuracy, but usually only about 3 &#8211;...Read More &gt;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/research.reading.ac.uk\/dare\/2017\/10\/18\/whats-in-a-number\/\" \/>\n<meta property=\"og:site_name\" content=\"DARE\" \/>\n<meta property=\"article:published_time\" content=\"2017-10-18T14:12:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-05-11T14:52:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/research.reading.ac.uk\/dare\/wp-content\/uploads\/sites\/5\/2017\/09\/Nichols-3.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"200\" \/>\n\t<meta property=\"og:image:height\" content=\"147\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sarah Dance\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sarah Dance\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/research.reading.ac.uk\/dare\/2017\/10\/18\/whats-in-a-number\/\",\"url\":\"https:\/\/research.reading.ac.uk\/dare\/2017\/10\/18\/whats-in-a-number\/\",\"name\":\"What\u2019s in a number? - DARE\",\"isPartOf\":{\"@id\":\"https:\/\/research.reading.ac.uk\/dare\/#website\"},\"datePublished\":\"2017-10-18T14:12:46+00:00\",\"dateModified\":\"2022-05-11T14:52:12+00:00\",\"author\":{\"@id\":\"https:\/\/research.reading.ac.uk\/dare\/#\/schema\/person\/762ebd58f82d756c38105c85b218e395\"},\"breadcrumb\":{\"@id\":\"https:\/\/research.reading.ac.uk\/dare\/2017\/10\/18\/whats-in-a-number\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/research.reading.ac.uk\/dare\/2017\/10\/18\/whats-in-a-number\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/research.reading.ac.uk\/dare\/2017\/10\/18\/whats-in-a-number\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/research.reading.ac.uk\/dare\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What\u2019s in a number?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/research.reading.ac.uk\/dare\/#website\",\"url\":\"https:\/\/research.reading.ac.uk\/dare\/\",\"name\":\"DARE\",\"description\":\"Data Assimilation for the REsilient City\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/research.reading.ac.uk\/dare\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/research.reading.ac.uk\/dare\/#\/schema\/person\/762ebd58f82d756c38105c85b218e395\",\"name\":\"Sarah Dance\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/research.reading.ac.uk\/dare\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8126dedc9bbd15dcb5b50b2ddf94f76a23204d2a5712cbdce92e4a936c5e9138?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8126dedc9bbd15dcb5b50b2ddf94f76a23204d2a5712cbdce92e4a936c5e9138?s=96&d=mm&r=g\",\"caption\":\"Sarah Dance\"},\"url\":\"https:\/\/research.reading.ac.uk\/dare\/author\/s-l-dancereading-ac-uk\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What\u2019s in a number? - DARE","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/research.reading.ac.uk\/dare\/2017\/10\/18\/whats-in-a-number\/","og_locale":"en_GB","og_type":"article","og_title":"What\u2019s in a number? - DARE","og_description":"By Nancy Nichols Should you care about the numerical accuracy of your computer?\u00a0 After all, most machines now retain about 16 digits of accuracy, but usually only about 3 &#8211;...Read More >","og_url":"https:\/\/research.reading.ac.uk\/dare\/2017\/10\/18\/whats-in-a-number\/","og_site_name":"DARE","article_published_time":"2017-10-18T14:12:46+00:00","article_modified_time":"2022-05-11T14:52:12+00:00","og_image":[{"width":200,"height":147,"url":"https:\/\/research.reading.ac.uk\/dare\/wp-content\/uploads\/sites\/5\/2017\/09\/Nichols-3.jpg","type":"image\/jpeg"}],"author":"Sarah Dance","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Sarah Dance","Estimated reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/research.reading.ac.uk\/dare\/2017\/10\/18\/whats-in-a-number\/","url":"https:\/\/research.reading.ac.uk\/dare\/2017\/10\/18\/whats-in-a-number\/","name":"What\u2019s in a number? - DARE","isPartOf":{"@id":"https:\/\/research.reading.ac.uk\/dare\/#website"},"datePublished":"2017-10-18T14:12:46+00:00","dateModified":"2022-05-11T14:52:12+00:00","author":{"@id":"https:\/\/research.reading.ac.uk\/dare\/#\/schema\/person\/762ebd58f82d756c38105c85b218e395"},"breadcrumb":{"@id":"https:\/\/research.reading.ac.uk\/dare\/2017\/10\/18\/whats-in-a-number\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/research.reading.ac.uk\/dare\/2017\/10\/18\/whats-in-a-number\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/research.reading.ac.uk\/dare\/2017\/10\/18\/whats-in-a-number\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/research.reading.ac.uk\/dare\/"},{"@type":"ListItem","position":2,"name":"What\u2019s in a number?"}]},{"@type":"WebSite","@id":"https:\/\/research.reading.ac.uk\/dare\/#website","url":"https:\/\/research.reading.ac.uk\/dare\/","name":"DARE","description":"Data Assimilation for the REsilient City","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/research.reading.ac.uk\/dare\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/research.reading.ac.uk\/dare\/#\/schema\/person\/762ebd58f82d756c38105c85b218e395","name":"Sarah Dance","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/research.reading.ac.uk\/dare\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8126dedc9bbd15dcb5b50b2ddf94f76a23204d2a5712cbdce92e4a936c5e9138?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8126dedc9bbd15dcb5b50b2ddf94f76a23204d2a5712cbdce92e4a936c5e9138?s=96&d=mm&r=g","caption":"Sarah Dance"},"url":"https:\/\/research.reading.ac.uk\/dare\/author\/s-l-dancereading-ac-uk\/"}]}},"cc_featured_image_caption":{"caption_text":"","source_text":"","source_url":""},"_links":{"self":[{"href":"https:\/\/research.reading.ac.uk\/dare\/wp-json\/wp\/v2\/posts\/295","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/research.reading.ac.uk\/dare\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/research.reading.ac.uk\/dare\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/research.reading.ac.uk\/dare\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/research.reading.ac.uk\/dare\/wp-json\/wp\/v2\/comments?post=295"}],"version-history":[{"count":3,"href":"https:\/\/research.reading.ac.uk\/dare\/wp-json\/wp\/v2\/posts\/295\/revisions"}],"predecessor-version":[{"id":1375,"href":"https:\/\/research.reading.ac.uk\/dare\/wp-json\/wp\/v2\/posts\/295\/revisions\/1375"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/research.reading.ac.uk\/dare\/wp-json\/wp\/v2\/media\/300"}],"wp:attachment":[{"href":"https:\/\/research.reading.ac.uk\/dare\/wp-json\/wp\/v2\/media?parent=295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/research.reading.ac.uk\/dare\/wp-json\/wp\/v2\/categories?post=295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/research.reading.ac.uk\/dare\/wp-json\/wp\/v2\/tags?post=295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}