{"id":146,"date":"2008-07-17T14:37:22","date_gmt":"2008-07-17T19:37:22","guid":{"rendered":"https:\/\/blogs.mathworks.com\/loren\/2008\/07\/17\/interpolating-polynomials\/"},"modified":"2018-01-08T14:48:04","modified_gmt":"2018-01-08T19:48:04","slug":"interpolating-polynomials","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/loren\/2008\/07\/17\/interpolating-polynomials\/","title":{"rendered":"Interpolating Polynomials"},"content":{"rendered":"<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\r\n   <introduction>\r\n      <p><tt>John D'Errico<\/tt> is back today to talk about interpolating polynomials.\r\n      <\/p>\r\n   <\/introduction>\r\n   <h3>Contents<\/h3>\r\n   <div>\r\n      <ul>\r\n         <li><a href=\"#1\">Introduction<\/a><\/li>\r\n         <li><a href=\"#2\">Exact Fit<\/a><\/li>\r\n         <li><a href=\"#4\">Interpolation should yield zero residuals at the data points<\/a><\/li>\r\n         <li><a href=\"#5\">Does the Data Have Replicates?<\/a><\/li>\r\n         <li><a href=\"#8\">Average the Replicates<\/a><\/li>\r\n         <li><a href=\"#9\">High Order Polynomials Not a Sure Bet<\/a><\/li>\r\n         <li><a href=\"#10\">Runge's Phenomenon<\/a><\/li>\r\n         <li><a href=\"#11\">Numerical Problems<\/a><\/li>\r\n      <\/ul>\r\n   <\/div>\r\n   <h3>Introduction<a name=\"1\"><\/a><\/h3>\r\n   <p>I talked in my <a href=\"https:\/\/blogs.mathworks.com\/loren\/2008\/06\/11\/interpolation-in-matlab\/\">last blog<\/a> about polynomial regression models. We saw some utility in polynomial models, and that increasing the order of the polynomial\r\n      caused the errors to decrease. How far can we go? Can we reduce the errors to zero?\r\n   <\/p>\r\n   <p>At some point, I might choose to increase the degree of the polynomial to one less than the number of data points. Assuming\r\n      that my data have no replicated points, this is an <a href=\"http:\/\/en.wikipedia.org\/wiki\/Polynomial_interpolation\"><tt>interpolating polynomial<\/tt><\/a> that fits our data exactly, at least to within the double precision accuracy of our computations. A straight line can pass\r\n      through any two points, a quadratic passes through three points, a cubic hits four points exactly, etc. If you prefer to think\r\n      in terms of statistical degrees of freedom, if you have <tt>n<\/tt> points, a polynomial of order <tt>n<\/tt>-1 (with <tt>n<\/tt> coefficients) passes through your data exactly.\r\n   <\/p>\r\n   <p>I've started this all out by talking about polynomial modeling in a least squares sense, or regression analysis. But really,\r\n      I wanted to talk about interpolation, as opposed to the approximations provided by polynomial regression. Perhaps this was\r\n      an indirect approach, but one of the things I feel important is to distinguish interpolation from the more general modeling\/curve\r\n      fitting tools used in mathematics. This difference is often unappreciated by many users of MATLAB.\r\n   <\/p>\r\n   <p>Let's start by sampling five points from an exponential function.<\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">format <span style=\"color: #A020F0\">short<\/span>\r\nx = (-2:1:2)';\r\ny = exp(x);\r\nplot(x,y,<span style=\"color: #A020F0\">'o'<\/span>)\r\ngrid <span style=\"color: #A020F0\">on<\/span><\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/loren\/146\/interpJD2_01.png\"> <h3>Exact Fit<a name=\"2\"><\/a><\/h3>\r\n   <p>While it is true that <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/polyfit.html\"><tt>polyfit<\/tt><\/a> gives an exact fit with an order <tt>n-1<\/tt> polynomial, a direct method is more efficient.\r\n   <\/p>\r\n   <p>Build an interpolating polynomial using <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/vander.html\"><tt>vander<\/tt><\/a> coupled with the use of <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/mrdivide.html\"><tt>backslash<\/tt><\/a>.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">P = vander(x)\\y\r\nxev = linspace(-2,2,500)';\r\nyev = polyval(P,xev);\r\n\r\nplot(x,y,<span style=\"color: #A020F0\">'ko'<\/span>,xev,yev,<span style=\"color: #A020F0\">'r-'<\/span>)\r\ngrid <span style=\"color: #A020F0\">on<\/span>\r\ntitle(<span style=\"color: #A020F0\">'Quartic polynomial through 5 points on exp(x)'<\/span>)<\/pre><pre style=\"font-style:oblique\">P =\r\n    0.0492\r\n    0.2127\r\n    0.4939\r\n    0.9625\r\n    1.0000\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/loren\/146\/interpJD2_02.png\"> <p>Many books teach you to use the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Lagrange_polynomial\"><tt>Lagrange form<\/tt><\/a> for interpolation. I won't get into that here because I don't really advise the use of polynomials in general.\r\n   <\/p>\r\n   <h3>Interpolation should yield zero residuals at the data points<a name=\"4\"><\/a><\/h3>\r\n   <p>Verify that the residuals are essentially zero at the data points.<\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">format <span style=\"color: #A020F0\">long<\/span> <span style=\"color: #A020F0\">g<\/span>\r\npred = polyval(P,x) - y<\/pre><pre style=\"font-style:oblique\">pred =\r\n    -1.11022302462516e-016\r\n    -1.11022302462516e-016\r\n                         0\r\n                         0\r\n                         0\r\n<\/pre><h3>Does the Data Have Replicates?<a name=\"5\"><\/a><\/h3>\r\n   <p>Suppose I have two points with the same independent variable value, but distinct values for the dependent variable? Since\r\n      for any given <tt>x<\/tt>, a single-valued function returns only a single value for the prediction, this <b>must<\/b> cause a problem. In this example, what value should I expect for an interpolant when <tt>x = 2<\/tt>? Should <tt>f(x)<\/tt> be <tt>3<\/tt> or <tt>4<\/tt>?\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">x = [0 1 2 2 3 4]';\r\ny = [1 2 3 4 5 6]';\r\nplot(x,y,<span style=\"color: #A020F0\">'-o'<\/span>)<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/loren\/146\/interpJD2_03.png\"> <p>You can see a hint of the problem if you look at the rank of the Vandermonde matrix. The rank should have been 6, but the\r\n      replicated point causes a singularity.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">rank(vander(x))<\/pre><pre style=\"font-style:oblique\">ans =\r\n     5\r\n<\/pre><p>This singularity results in a rather useless polynomial.<\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">P = vander(x)\\y<\/pre><pre style=\"font-style:oblique\">Warning: Matrix is singular to working precision.\r\nP =\r\n   NaN\r\n   NaN\r\n   NaN\r\n  -Inf\r\n   Inf\r\n     1\r\n<\/pre><h3>Average the Replicates<a name=\"8\"><\/a><\/h3>\r\n   <p>If the data truly is not single-valued, the common approach is to use a parametric relationship. (This is something to save\r\n      for a possible future blog.)\r\n   <\/p>\r\n   <p>Much of the time however, I just want to do something simple, like average the replicate points. <a title=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/loadFile.do?objectId=8354&amp;objectType=file (link no longer works)\"><tt>consolidator<\/tt><\/a>, a tool I contributed to the File Exchange, can do just that. If you've never found or looked at the file exchange, please\r\n      take some time to wander through the great tools there.\r\n   <\/p>\r\n   <h3>High Order Polynomials Not a Sure Bet<a name=\"9\"><\/a><\/h3>\r\n   <p>Sometimes polynomials don't do so well. It is important to know your data, know your problem. Here the data comes from a function\r\n      known to be monotone increasing. Polynomials don't like to be monotone, so forcing a high order polynomial to interpolate\r\n      such a function is a sure way to fail.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">x = (-5:1:5)';\r\ny = erf(x);\r\n\r\nP = vander(x)\\y\r\nxev = linspace(-5,5,1000)';\r\nyev = polyval(P,xev);\r\n\r\nplot(x,y,<span style=\"color: #A020F0\">'ko'<\/span>,xev,yev,<span style=\"color: #A020F0\">'r-'<\/span>)\r\ngrid <span style=\"color: #A020F0\">on<\/span>\r\ntitle(<span style=\"color: #A020F0\">'Interpolating polynomial through 11 points on erf(x)'<\/span>)<\/pre><pre style=\"font-style:oblique\">P =\r\n     3.49245965480804e-020\r\n      2.0991424886728e-005\r\n    -1.58112816820803e-018\r\n      -0.00119783140998794\r\n     2.17562811018059e-017\r\n        0.0239521737329468\r\n    -9.91270557701033e-017\r\n        -0.211403900317105\r\n     1.85037170770859e-016\r\n          1.03132935951897\r\n                         0\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/loren\/146\/interpJD2_04.png\"> <h3>Runge's Phenomenon<a name=\"10\"><\/a><\/h3>\r\n   <p><a href=\"http:\/\/en.wikipedia.org\/wiki\/Runge's_phenomenon\"><tt>Runge<\/tt><\/a> found this example of a function that causes high order interpolating polynomials to fare very poorly.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">x = (-5:1:5)';\r\ny = 1.\/(1+x.^2);\r\nP = vander(x)\\y\r\nxev = linspace(-5,5,1000)';\r\nyev = polyval(P,xev);\r\nytrue = 1.\/(1+xev.^2);\r\n\r\nplot(x,y,<span style=\"color: #A020F0\">'ko'<\/span>,xev,yev,<span style=\"color: #A020F0\">'r-.'<\/span>,xev,ytrue,<span style=\"color: #A020F0\">'g-'<\/span>)\r\nlegend(<span style=\"color: #A020F0\">'Data points'<\/span>,<span style=\"color: #A020F0\">'Interpolating polynomial'<\/span>,<span style=\"color: #A020F0\">'y = 1.\/(1+x.^2)'<\/span>)\r\ngrid <span style=\"color: #A020F0\">on<\/span>\r\ntitle(<span style=\"color: #A020F0\">'Runge example'<\/span>)<\/pre><pre style=\"font-style:oblique\">P =\r\n    -2.26244343891403e-005\r\n     1.04238735515992e-019\r\n       0.00126696832579186\r\n    -4.47734652027112e-018\r\n       -0.0244117647058824\r\n     5.61044648135202e-017\r\n          0.19737556561086\r\n    -2.38551402729053e-016\r\n         -0.67420814479638\r\n     1.38777878078145e-016\r\n                         1\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/loren\/146\/interpJD2_05.png\"> <h3>Numerical Problems<a name=\"11\"><\/a><\/h3>\r\n   <p>You also need to worry about numerical issues in high order polynomial interpolants. The matrices you would create are often\r\n      numerically singular.\r\n   <\/p>\r\n   <p>For example, the rank of the matrix <tt>vander(1:n)<\/tt> should be <tt>n<\/tt>. However, this fails when working in finite precision arithmetic.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">rank(vander(1:10))\r\nrank(vander(1:20))\r\nrank(vander(1:30))<\/pre><pre style=\"font-style:oblique\">ans =\r\n    10\r\nans =\r\n     7\r\nans =\r\n     6\r\n<\/pre><p>Centering and scaling your data can improve the numerical performance of a high order polynomial to some extent, but that\r\n      too has a limit. You are usually better off using other interpolation methods.\r\n   <\/p>\r\n   <p>What can you do? You want to be able to interpolate your data. Polynomials seem like a good place to look, but they have their\r\n      issues. High order polynomial interpolation often has problems, either resulting in non-monotonic interpolants or numerical\r\n      problems. You might consider other families of functions to build your interpolant, for example trig or bessel functions,\r\n      or orthogonal polynomials. Much depends on the relationship you want to model. KNOW YOUR PROBLEM!\r\n   <\/p>\r\n   <p>By the way, for those who are interested in the methodology of modeling and curve fitting, I list a few ideas in this <a>thread<\/a> that should be of interest.\r\n   <\/p>\r\n   <p>We can still do much with polynomials however. They form the basis for many modeling tools.<\/p>\r\n   <p>A nice trick is to go simple. Why use a single high order polynomial to interpolate our data? Instead, break the problem up\r\n      and use smaller segments of low order polynomials, pieced together. In my next blog I'll begin talking about these piecewise\r\n      interpolants. Until then please tell me <a href=\"https:\/\/blogs.mathworks.com\/loren\/?p=146#respond\"><tt>here<\/tt><\/a> where you have found interpolating polynomials of use, or if you have found problems that they cannot solve.\r\n   <\/p><script language=\"JavaScript\">\r\n<!--\r\n\r\n    function grabCode_5a0247dd9aa741c59b5d44eca16fd1d7() {\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='5a0247dd9aa741c59b5d44eca16fd1d7 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 5a0247dd9aa741c59b5d44eca16fd1d7';\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        author = 'Loren Shure';\r\n        copyright = 'Copyright 2008 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 author and copyright lines at the bottom if specified.\r\n        if ((author.length > 0) || (copyright.length > 0)) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (author.length > 0) {\r\n                d.writeln('% _' + author + '_');\r\n            }\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      \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_5a0247dd9aa741c59b5d44eca16fd1d7()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n            the MATLAB code \r\n            <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; 7.6<br><\/p>\r\n<\/div>\r\n<!--\r\n5a0247dd9aa741c59b5d44eca16fd1d7 ##### SOURCE BEGIN #####\r\n%% Interpolating Polynomials\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/loadAuthor.do?objectId=801347&objectType=author |John D'Errico|>\r\n% is back today to talk about interpolating polynomials.\r\n%% Introduction\r\n% I talked in my \r\n% <https:\/\/blogs.mathworks.com\/loren\/2008\/06\/11\/interpolation-in-matlab\/ last blog>\r\n% about polynomial regression models. We saw\r\n% some utility in polynomial models, and that increasing the order of the\r\n% polynomial caused the errors to decrease. How far can we go? Can we\r\n% reduce the errors to zero?\r\n% \r\n% At some point, I might choose to increase the degree of the polynomial\r\n% to one less than the number of data points. Assuming that my data have no\r\n% replicated points, this is an\r\n% <http:\/\/en.wikipedia.org\/wiki\/Polynomial_interpolation |interpolating polynomial|>\r\n% that fits our data exactly,\r\n% at least to within the double precision accuracy of our computations.\r\n% A straight line can pass through any two points, a quadratic passes\r\n% through three points, a cubic hits four points exactly, etc. If you\r\n% prefer to think in terms of statistical degrees of freedom, if you\r\n% have |n| points, a polynomial of order |n|-1 (with |n| coefficients)\r\n% passes through your data exactly.\r\n% \r\n% I've started this all out by talking about polynomial modeling in a\r\n% least squares sense, or regression analysis. But really, I wanted to\r\n% talk about interpolation, as opposed to the approximations provided by\r\n% polynomial regression. Perhaps this was an indirect approach, but one\r\n% of the things I feel important is to distinguish interpolation from the\r\n% more general modeling\/curve fitting tools used in mathematics. This\r\n% difference is often unappreciated by many users of MATLAB.\r\n% \r\n% Let's start by sampling five points from an exponential function.\r\nformat short\r\nx = (-2:1:2)';\r\ny = exp(x);\r\nplot(x,y,'o')\r\ngrid on\r\n\r\n%% Exact Fit\r\n% While it is true that\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/polyfit.html |polyfit|>\r\n% gives an exact fit with an order |n-1| polynomial, a direct method is\r\n% more efficient.\r\n%\r\n% Build an interpolating polynomial using\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/vander.html |vander|>\r\n% coupled with the use of\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/mrdivide.html |backslash|>.\r\nP = vander(x)\\y\r\nxev = linspace(-2,2,500)';\r\nyev = polyval(P,xev);\r\n\r\nplot(x,y,'ko',xev,yev,'r-')\r\ngrid on\r\ntitle('Quartic polynomial through 5 points on exp(x)')\r\n\r\n%%\r\n% Many books teach you to use the\r\n% <http:\/\/en.wikipedia.org\/wiki\/Lagrange_polynomial |Lagrange form|>\r\n% for interpolation. I won't get into that here because I don't really\r\n% advise the use of polynomials in general.\r\n\r\n%% Interpolation should yield zero residuals at the data points\r\n% Verify that the residuals are essentially zero at the data points.\r\nformat long g\r\npred = polyval(P,x) - y\r\n\r\n%% Does the Data Have Replicates?\r\n% Suppose I have two points with the same independent variable value, but\r\n% distinct values for the dependent variable? Since for any given |x|, a\r\n% single-valued function returns only a single value for the prediction,\r\n% this *must* cause a problem. In this example, what value should I expect\r\n% for an interpolant when |x = 2|? Should |f(x)| be |3| or |4|?\r\nx = [0 1 2 2 3 4]';\r\ny = [1 2 3 4 5 6]';\r\nplot(x,y,'-o')\r\n%%\r\n% You can see a hint of the problem if you look at the rank of the\r\n% Vandermonde matrix. The rank should have been 6, but the replicated point\r\n% causes a singularity.\r\nrank(vander(x))\r\n\r\n%%\r\n% This singularity results in a rather useless polynomial.\r\nP = vander(x)\\y\r\n\r\n%% Average the Replicates\r\n% If the data truly is not single-valued, the common approach is to use a\r\n% parametric relationship. (This is something to save for a possible future\r\n% blog.)\r\n% \r\n% Much of the time however, I just want to do something simple, like\r\n% average the replicate points. \r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/loadFile.do?objectId=8354&objectType=file |consolidator|>,\r\n% a tool I contributed to the File Exchange, can do just that. If you've\r\n% never found or looked at the file exchange, please take some\r\n% time to wander through the great tools there.\r\n\r\n%% High Order Polynomials Not a Sure Bet\r\n% Sometimes polynomials don't do so well. It is important to know\r\n% your data, know your problem. Here the data comes from a function\r\n% known to be monotone increasing. Polynomials don't like to be\r\n% monotone, so forcing a high order polynomial to interpolate such\r\n% a function is a sure way to fail.\r\nx = (-5:1:5)';\r\ny = erf(x);\r\n\r\nP = vander(x)\\y\r\nxev = linspace(-5,5,1000)';\r\nyev = polyval(P,xev);\r\n\r\nplot(x,y,'ko',xev,yev,'r-')\r\ngrid on\r\ntitle('Interpolating polynomial through 11 points on erf(x)')\r\n%% Runge's Phenomenon\r\n% <http:\/\/en.wikipedia.org\/wiki\/Runge's_phenomenon |Runge|>\r\n% found this example of a function that causes high order\r\n% interpolating polynomials to fare very poorly.\r\nx = (-5:1:5)';\r\ny = 1.\/(1+x.^2);\r\nP = vander(x)\\y\r\nxev = linspace(-5,5,1000)';\r\nyev = polyval(P,xev);\r\nytrue = 1.\/(1+xev.^2);\r\n\r\nplot(x,y,'ko',xev,yev,'r-.',xev,ytrue,'g-')\r\nlegend('Data points','Interpolating polynomial','y = 1.\/(1+x.^2)')\r\ngrid on\r\ntitle('Runge example')\r\n\r\n%% Numerical Problems\r\n% You also need to worry about numerical issues in high order polynomial\r\n% interpolants. The matrices you would create are often numerically singular.\r\n% \r\n% For example, the rank of the matrix |vander(1:n)| should be |n|. However,\r\n% this fails when working in finite precision arithmetic.\r\nrank(vander(1:10))\r\nrank(vander(1:20))\r\nrank(vander(1:30))\r\n\r\n%%\r\n% Centering and scaling your data can improve the numerical performance of\r\n% a high order polynomial to some extent, but that too has a limit. You are \r\n% usually better off using other interpolation methods.\r\n\r\n%%\r\n% What can you do? You want to be able to interpolate your data. Polynomials\r\n% seem like a good place to look, but they have their issues. High order\r\n% polynomial interpolation often has problems, either resulting in non-monotonic\r\n% interpolants or numerical problems. You might consider other\r\n% families of functions to build your interpolant, for example trig or bessel\r\n% functions, or orthogonal polynomials. Much depends on the relationship \r\n% you want to model. KNOW\r\n% YOUR PROBLEM! \r\n%\r\n% By the way, for those who are interested in the methodology of modeling\r\n% and curve fitting, I list a few ideas in this\r\n% <http:\/\/view_thread\/172450 thread>\r\n% that should be of interest.\r\n%\r\n% We can still do much with polynomials however. They form the basis for\r\n% many modeling tools.\r\n% \r\n% A nice trick is to go simple. Why use a single high order polynomial to\r\n% interpolate our data? Instead, break the problem up and use smaller\r\n% segments of low order polynomials, pieced together. In my next blog\r\n% I'll begin talking about these piecewise interpolants. Until then\r\n% please tell me \r\n% <https:\/\/blogs.mathworks.com\/loren\/?p=146#respond |here|>\r\n% where you have found interpolating polynomials of use, or if you\r\n% have found problems that they cannot solve.\r\n\r\n\r\n##### SOURCE END ##### 5a0247dd9aa741c59b5d44eca16fd1d7\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\n   \r\n      John D'Errico is back today to talk about interpolating polynomials.\r\n      \r\n   \r\n   Contents\r\n   \r\n      \r\n         Introduction\r\n... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/loren\/2008\/07\/17\/interpolating-polynomials\/\">read more >><\/a><\/p>","protected":false},"author":39,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[23],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/146"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/users\/39"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/comments?post=146"}],"version-history":[{"count":2,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/146\/revisions"}],"predecessor-version":[{"id":2538,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/146\/revisions\/2538"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/media?parent=146"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/categories?post=146"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/tags?post=146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}