|
From: | Przemek Klosowski |
Subject: | Re: Extrapolation |
Date: | Mon, 19 Aug 2013 12:35:54 -0400 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8 |
On 08/18/2013 02:37 PM, Sarah wrote:
I want to do interpolation and extrapolation. I can interpolate by using interp2 command. But, this command didn't perform extrapolation. Is there any built-in function for extrapolation in octave? I have given an example in detail. a= [ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17];
...
cim= interp2(a, b, cc, ai, bi) % Interpolation matrix ce= interp2(a, b, cc, 18, 0.2) % Extrapolation at some point
...
How can I find 'ce' and 'cem' in this case? Here, it gives "NA". How should I extrapolate to find 'ce' and 'cem' ?
'interp2' is indeed doing interpolation, and additionally it requires monotonic coordinates (your a() array is not monotonic). I don't know of a standard extrapolation package--depending on what's appropriate in your case, you might try to add a guard-band around your data by duplicating the values for x=17.
I am sure you did read 'help interp2' already but take another look: it specifies the monotonicity requirement, and also talks about different algorithms that can be used for interpolation.
[Prev in Thread] | Current Thread | [Next in Thread] |