Note that there are some explanatory texts on larger screens.

plurals
  1. POInterpolation in vector-valued multi-variate function
    primarykey
    data
    text
    <p>In Python, I'm trying to construct a routine that interpolates in vector-valued data in a multi-dimensional (5+) parameter space. i.e. I have a function that takes a number of input variables and returns a number of output variables. At the moment, there is one call for each element of the vector. The data is in a columned file, so I retrieve it with</p> <pre><code>import numpy [x_data,y_data,f1_data,f2_data] = numpy.loadtxt('data',unpack=True) </code></pre> <p>Then, I instantiate individual interpolators using SciPy's functions, like</p> <pre><code>from scipy import interpolate f1 = interpolate.LinearNDInterpolator((x_data,y_data),f1_data) f2 = interpolate.LinearNDInterpolator((x_data,y_data),f2_data) ... </code></pre> <p>Now, when I make the interpolation call, I have to interpolate for each value <code>f1</code>, <code>f2</code>, etc. even though really it should be achievable as one operation. And I'm guessing that making one interpolation should be faster than making 5 or more.</p> <p><em>Is there a way to construct a vector- (or array-) valued interpolator?</em></p> <p>I tried constructing the interpolator with</p> <pre><code>f = interpolate.LinearNDInterpolator((x_data,y_data),(f1_data,f2_data,...)) </code></pre> <p>but it returns the error</p> <blockquote> <p>ValueError: different number of values and points</p> </blockquote> <p>I've also read <a href="https://stackoverflow.com/questions/11129958/vector-valued-function-interpolation-using-numpy-scipy" title="this question">this question and answer</a> but it's about a vector-valued function of a scalar, which can apparently be handled by <code>interp1d</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload