19 votes

What is the preferred and efficient approach for interpolating multidimensional data?

For the first part of my question, I found this very useful comparison for performance of different linear interpolation methods using python libraries: http://nbviewer.ipython.org/github/pierre-...
user avatar
14 votes

Example of a continuous function that is difficult to approximate with polynomials

Why not simply show the absolute value function? Approximation with e.g. Legendre-polynomial expansion works, but pretty badly: Taylor expansion is of course completely useless here, always giving ...
user avatar
10 votes
Accepted

Interpolation by Solving a Minimization Problem (Optimization)

This is the classic colorization using optimization problem. Optimization and Linear Algebra To see how this can be expressed as a linear system, it's helpful to use a slightly different notation (...
user avatar
  • 216
10 votes

Example of a continuous function that is difficult to approximate with polynomials

It's a pathological case, but you can always resort to the Weierstrass monster function. It illustrates a broader point, namely that functions that are not smooth -- e.g., that have a kink -- are ...
user avatar
9 votes
Accepted

Linear interpolation in Fortran

There is no built-in Fortran functionality to do linear interpolation. You could either use a library or write your own routine. I haven't tried compiling or testing and my fortran may be a bit rusty, ...
user avatar
9 votes
Accepted

Interpolating a mathematical function using a Hermite Cubic Finite Element Space

Short answer You are missing the Jacobian of the transformation for the derivatives. Long answer The conditions that you propose for your interpolator translate into the following system of ...
user avatar
  • 8,006
8 votes

Is there a Gauss-Laguerre integration routine in Python?

There are standard methods for these types of quadrature in Python, in NumPy and SciPy: Gauss-Laguerre quadrature Gauss-Legendre quadrature Gauss-Hermite quadrature (as noted in your post) Gauss-...
user avatar
8 votes

Approximating a step function with polynomials

This problem is generally called the Minimax Problem. Unfortunately the step function is not continuous and therefore the Weierstrass approximation theorem does not apply. Any continuous approximation ...
user avatar
8 votes

Interpolate the orbital coordinates of an object using coordinates and velocities vector

That depends on how well you know the coordinates and velocities. If you have exact values, you can get a reasonable answer using Hermite interpolation. This will give you a degree-3 polynomial in ...
user avatar
7 votes
Accepted

Error of interpolating polynomial

For a polynomial interpolant we have the formula for the pointwise error $$ E_n(x) = f(x) - p_n(x) = \frac{f^{(n+1)}}{(n+1)!}\prod_{i=0}^n(x-x_i),$$ where the $x_i$ are the interpolation knots. In ...
user avatar
7 votes

Fourier transform by FFT : by using cubic splines to interpolate between data points, do we change the frequency content of the Fourier transform?

The frequency content of the interpolated signal is significantly influenced by the interpolation basis. If you have a band-limited function that you have adequately sampled (i.e. satisfying Nyquist ...
user avatar
7 votes
Accepted

Parametrized spline - oscilating second derivative

Your choice of parameterization is creating problems. Instead of spanning one in $t$ between points, span an amount proportional to the line segment between the two points in $(x,y)$ space. I've ...
user avatar
  • 1,133
7 votes
Accepted

What are the benefits of using machine learning for interpolation over traditional interpolation methods?

First of all, interpolation and approximation are slightly different from each other. Given a sufficiently smooth function $f$ (sufficiently smooth just means that I am covering my bases, there are ...
user avatar
7 votes

What is the difference between $u_h$ and $I_h(u)$ in finite element literature?

The other answer has everything you already need, but it's also worth pointing out that $u_h$ is computable whereas $I_hu$ is not: The latter requires you to know the exact solution, which in general ...
user avatar
6 votes
Accepted

Interpolation with the roots of orthogonal polynomials & Spectral expansion

I hope I understood the question correctly. They try to compute exactly the same thing, so they really are equivalent. I'll use Chebyshev polynomials because they are easy to analyze. Given a ...
user avatar
  • 11.4k
6 votes
Accepted

Evaluating an integral numerically at many points

The point of @WolfgangBangerth is exactly what I mentionend in my comment, so I'd always try this first. In the best case, with millions of partitions $[a_{i},a_{i+1}]_{i\in \{0,\ldots,N-1\}}$ (where $...
user avatar
  • 2,467
6 votes

Example of a continuous function that is difficult to approximate with polynomials

Approximation is not only made hard by the function to be approximated but by the interval in which the approximation should be a "good fit". And you should define the measure for a "good fit", i.e. ...
user avatar
  • 6,066
6 votes

Example of a continuous function that is difficult to approximate with polynomials

Polynomials are surprisingly effective at function approximation [1]. If you have at least Lipschitz continuity, then Chebyshev approximations will converge. Of course, convergence may be slow, and ...
user avatar
  • 2,983
6 votes

Get the roots of a Hermite interpolating polynomial

The interpolated polynomial does not have roots. Considering that the behavior outside the interpolation region holds is termed extrapolation. You can explicitly use the polynomial, given by (as I ...
user avatar
  • 8,006
6 votes

What is the difference between $u_h$ and $I_h(u)$ in finite element literature?

Let's assume $u$ is the solution to the variational problem and $u_h$ is the Galerkin approximation of the solution on the subspace $V_h \subset V$. By Cea's lemma you have: \begin{equation} ||u-u_h||...
user avatar
  • 329
5 votes
Accepted

Generating harmonic polynomials in cartesian coordinates

Overview These types of polynomials are used in quantum chemistry, potential theory, magnet shimming, and probably many other branches of science. One problem is that the nomenclature seems to be ...
user avatar
5 votes

Is there any function gives no interpolation error in numerical analysis

Any polynomial interpolation method will include a 0th-order term and thus interpolate a constant exactly. Further, some methods have the nice property that they can interpolate polynomials up to ...
user avatar
5 votes

Fourier transform by FFT : by using cubic splines to interpolate between data points, do we change the frequency content of the Fourier transform?

The interpolation indeed affects the Fourier transform. @Steve already gives the correct answer in general, but I want to give you an example that helps the intuition more. Think for example that you ...
user avatar
5 votes

Barycentric interpolation equivalent for irregular hexahedra

A hexahedron with straight edges is the image of the unit cube under a trilinear mapping. So, if you have values on the eight vertices of a hexahedron, and you are asking to interpolate between them ...
user avatar
5 votes
Accepted

Interpolation of function onto mesh gives different results, depending on mesh density

You assume that a property that holds for the original function $f$ is also true for the $L_2$ projection $u_h=P_h f$. In your case, the property is that if $f$ is non-negative, then $u_h$ should also ...
user avatar
5 votes

Interpolating the gradient of a cylindrically symmetric potential field expected obey the Laplace equation, especially near/across r=0

Provided that your geometry conforms to the cylindrical coordinate system, the separation of variables solution should look something like $$ \Phi(\mathbf{r}) = \sum_{n,m} a_{nm} \left\lbrace \begin{...
user avatar
  • 653
5 votes
Accepted

At which stage to interpolate?

This will implicitly depend on your function, $F$, as well as the method you used to derive your $f$ and $g$. If your $F$ were, say, the constant function $F(y,z)=1$, then you'd be guaranteed to have ...
user avatar
  • 2,199
5 votes

Polynomial interpolation on a regular hexagon

Since you are trying to find the gradient of the function in the vertices of a triangular mesh. So, we are considering an interpolation over the dual mesh defining the value on each centroid, you can ...
user avatar
4 votes

Help deciding between cubic and quadratic interpolation in line search

There is a paper by Moré, implemented by Nocedal, about that: Jorge J. Moré and David J. Thuente. 1994. Line search algorithms with guaranteed sufficient decrease. ACM Trans. Math. Softw. 20, 3 ...
user avatar
4 votes
Accepted

Help deciding between cubic and quadratic interpolation in line search

Hmm... cubic interpolation is not unheard of for line search, but typically overkill. If I'm reading your problem correctly, $x$ is just a scalar? In this case BFGS is probably not the most efficient ...
user avatar
  • 2,473

Only top scored, non community-wiki answers of a minimum length are eligible