Lecture 5: Iterpolato olyomal terpolato Ratoal appromato Coeffcets of the polyomal
Iterpolato: Sometme we kow the values of a fucto f for a fte set of pots. Yet we wat to evaluate f for other values perhaps cotaed wth the rage of terpolato or outsde t etrapolato. To do ths, we eed to model the behavor of the fucto sce we do t kow t for these other pots, usually by shootg a smooth curve that wll go through the avalable pots. The most commo terpolato schemes are based o polyomals, or quotets of polyomals. Trgoometrc fuctos are also used, but we wll treat that subject later o the course. There s a etesve mathematcal lterature, stemmg sometmes from cetures ago wth powerful theorems about errors, etc, terpolato stuatos. Ths lterature s geeral useless, because t requres kowledge of the fucto f we do t usually have.
Some geeral ssues: Coceptually, the terpolato process has two stages: determe the fucto that terpolates ad the evaluate t at the pot of terest. Ths s ot the best procedure practce: t usually s more costly ad proe to roud-off errors tha to start wth the value oe has for f that s based o closer to the pot of terest ad to add certa correctos to t. The cardalty of the subset of pots of oe uses to geerate the terpolatg fucto mus oe s called the order of the terpolatg scheme.
Oe ca always fd fuctos that make a mockery of ay terpolato scheme at a gve pot. It s good practce therefore to costruct methods that ca somehow relably estmate the error the terpolato. f 3 L[ π 4 π ]
Hgher order does ot guaratee better accuracy. For stace, hgher order polyomals ted to wggle betwee the prescrbed pots especally far away from each other rather tha produce a smoother fucto. If oe uses addtoal pots closer to the oe of terest thgs get better, but ths s ot always a opto.
The fucto that results from a local terpolato s usually ot well behaved whe oe computes dervatves, sce movg from pot to pots swtches the set of pots used ad therefore does ot yeld smooth dervatves. If the purpose of the terpolato s to compute especally hgh order dervatves the oe eeds a scheme that at each pot s able to supply such dervatve accurately. A eample s the sple method that assgs a polyomal locally usg o-local values. We wll dscuss t et class. Whe the total umber of s used s much larger tha the order of terpolato, a o-trval part of the task s to fd where wth the table of s to apply the method.
olyomal terpolato: Through ay two pots goes a straght le, through ay three pots a quadratc, etc. I geeral ths s the cotet of Lagrage s terpolatg formula. Gve y f, y f, y f, we ca get a polyomal of degree - by, 3 3 3 3............ y y y......... We have terms, all of degree -, ad all desged to be zero at all of the ecept oe, at whch t has the value y. Let us work o a error estmate for ths formula.
Error estmate of Lagrage s formula: Costruct: t f t t f t g ] [ ow, t s true that g k Vash It s also true that g The gt vashes for pots:,,,, If f belogs to C, the oe ca apply Rolle s theorem, whch states that somewhere at a pot ξ the terval defed by the above pots t has to happe that, ξ g t dt d f f g ] [ ξ ξ ξ So ths term vashes Ad ths term s a polyomal of degree, therefore,
lower degree terms t t Therefore, t dt d! uttg all ths together, we get, f f! ] [ ξ Or, f f! ξ It resembles the formula for the error the Taylor formula.
f f ξ! Ths formula ehbts why these kds of results are usually ot that useful. It requres to kow that the dervatve of order ests, ad t requres a boud for t the terval. Implemetg Lagrage s formula drectly a program s also kd of awkward to program a ecoomcal way. Let us ow take a look at a alteratve formula that s more effcet ad has a easer error estmate. It s called evlle s algorthm. Let be the polyomal of degree - that passes through the pots... : y evlle s observato s that these objects form a tableau of acestors ad progey 3 4 : : : y y y 3 4 3 4 3 34 3 34 34...
evlle s formula s... m m... m m... m You ca check the formula eplctly, however oe ca quckly covce oeself that t works by otcg that the progetors cocde for m- Oe ca get a very effcet algorthm by cosderg the small dffereces betwee progetors ad progey, C m,... m... m D m,... m... m Oe ca derve D m, m, m C C m, m m, m The fal s gve by the sum of ay y plus all the C s that form a path from y to the desred through the famly tree. C D D m, m,
subroute polta,ya,,,y,dy parameter ma dmeso a,ya,cma,dma s dfabs-a do, dftabs-a f dft.lt.df the s dfdft edf cya dya cotue yyas ss- Looks for closest progetor Compute C s & D s do 3 m,- do,-m hoa- hpam- wc-d deho-hp fde.eq..pause dew/de dhp*de cho*de cotue f *s.lt.-mthe dycs else dyds ss- edf yydy 3 cotue retur ed Update
Ratoal appromatos: R... m p q p q... p... q s r s r m r s The ma advatage of ratoal appromatos s that they allow to model fuctos wth poles zeros of the deomator. Ths ca be more mportat tha oe thks: eve f a fucto of Ths ca be more mportat tha oe thks: eve f a fucto of a real varable does ot have a pole, t mght have oe f eteded to the comple plae. If a fucto has a pole the comple plae, a power seres wll oly be a good appromato far away from the pole, eve f we restrct ourselves oly to the real as.
Ratoal appromatos ca be used terpolatos, but also aalytc work, for stace choosg a ratoal appromato that epaded power seres agrees wth the power seres of the fucto f of terest. Such appromato s called adé appromato. We wll dscuss ths appromato later o the course. The formulae for ratoal appromatos are smlar to those for polyomal oes. Bulrsch ad Stoer have come up wth a evlle type relato for the R coeffcets. I umercal Recpes there s a codg of ths relatoshp. The cocepts are all the same as before, troducg the C s, D s, progetors, progey, etc, so we wll ot repeat them here.
Coeffcets of the terpolatg polyomal: A polyomal s othg more tha ts coeffcets My algebra teacher, ca. 983 Ths s true prcple, but umercally you should make sure that t s the coeffcets what you eed. The coeffcets geeral ca be determed to much less accuracy tha the value of the polyomal at some pot. The evlle method we descrbed, for stace, returs the eact values for s, whereas f oe frst computes the coeffcets ad the evaluates the polyomal for the s roudoff errors wll gve less accurate results. Oe mght eed the coeffcets f oe wats to obta somethg else, lke a dervatve of the polyomal, or perhaps ts covoluto agast aother fucto whose momets are kow.
To get the coeffcets oe smply wrtes: 3... c c c c y y y c c L L Ad evaluatg the polyomal for all the pots gve, oe gets a system of lear equatos for the c s, y c M M L M M M M Matrces lke the oe o the left are called Vadermode matrces Ad oe ca hadle t usg the stadard techques for lear systems that we wll dscuss the course later o.
A trck for hadlg Vadermode matrces: Cosder the polyomal,, j j k k A jk Ths polyomal s costructed so t vashes for all s, ecept for j, for whch t takes the value oe. I other words, δ j A jk k k But ths mples that A s the matr verse of the Vadermode matr! Effcet algorthms ca be costructed to buld the coeffcets of the polyomal ad therefore A eplctly see umercal Recpes.
Summary It s better to use techques that appromate the value tha to compute the terpolatg polyomal ad evaluate. As fte dffereces, hgher order does ot mea hgher accuracy for terpolato. evlle s algorthms of progetors ad progey are effcet.