13 votes

Faster Logistic Function

Yes! There are nice approximations of the logistic. Plot of Approximating Functions As shown below, several functions approximate the logistic (shown as blue dots). This graph is available ...
Richard's user avatar
  • 3,961
10 votes
Accepted

Numerical evaluation of the Exponential Integral Ei by rational Chebyshev approximations fails

There is a prime missing both in your code and in the expression in your question. In the original paper, the expression is: $$ \log(x/x_0) + (x-x_0) \frac{\sum^\prime_{0\leq j\leq n}p_j T_j^*(x/6)}{\...
Kirill's user avatar
  • 11.4k
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 ...
Kirill's user avatar
  • 11.4k
6 votes

Approximate spectrum of a large matrix

Arnold Neumaier's answer is discussed in more detail in section 3.2 of the paper "Approximating Spectral Densities of Large Matrices" by Lin Lin, Yousef Saad and Chao Yang (2016). Some other methods ...
A. Van Werde's user avatar
6 votes
Accepted

General approach to infinite sums

Note the identity for the modified Bessel functions of the first kind, $ e^z = I_0(z) + 2 \sum_{k=1}^{\infty} I_k(z) $ (Abramowitz and Stegun, Eq. 9.6.34, https://personal.math.ubc.ca/~cbm/aands/...
Maxim Umansky's user avatar
6 votes

Faster Logistic Function

If only low-accuracy approximations are needed, it is highly advisable to perform all computation in single precision, for example IEEE-754 binary32 format, usually ...
njuffa's user avatar
  • 1,865
5 votes
Accepted

Does this Algorithm (probably Fourier like) Exist for 2D Shapes?

You can write a curve as a parametric equation ($x(t)$, $y(t)$) for a range say $0 < t < 1$. Then you can have a Fourier decomposition of both $x(t)$ and $y(t)$. A rectangle can be written as ...
Sarvottamananda's user avatar
5 votes
Accepted

Taylor expansion of error - Finite elements approximation

The question you ask is simpler than you may think. For any mesh size $h$, you can compute $\lambda(h)$. If this dependence is continuous, then you can do a Taylor expansion of $\lambda(h)$ around $h=...
Wolfgang Bangerth's user avatar
5 votes

approximate function such that the inverse of the approximation is "simple"

I think this is a really cool question, which might have a really cool answer, if someone was willing to think about it hard enough to publish on. But when we're talking smooth functions which need ...
user14717's user avatar
  • 2,155
5 votes
Accepted

Size of jump for piecewise discontinuous approximations

I believe that for odd polynomial degrees you can get superconvergence by one order at the jump. For even degrees I don't think that's the case. For the odd case, we consider a smooth function $u:\...
Will P.'s user avatar
  • 811
5 votes
Accepted

Finding the parameters of a function via curve fit

If you transform your formula and data to the reciprocals, you get $$ \frac1y=\frac1v\left(\frac{k^n}{x^n}+1\right) $$ or $$ y^{-1}=Ax^{-n}+B $$ The graph of this should be an $n$th power parabola ...
Lutz Lehmann's user avatar
  • 5,984
5 votes
Accepted

How to optimize an approximated matrix multiplication?

This is a linear least squares problem if you just look at it the right way. Write $$ B = (I-aX)^{-1}, $$ then $X = \frac{1}{a}(I-B^{-1})$ and $$ (I-aX)^{-1}XA = B\frac{1}{a}(I-B^{-1})A = \frac{1}{...
Wolfgang Bangerth's user avatar
4 votes
Accepted

Methods for fast approximation of convolution

Fast filter approximations have been studied for a long time, especially to implement IIR filters, like Gaussians and their derivatives. You may want to reuse such concepts, with keywords like ...
Laurent Duval's user avatar
4 votes

What algorithm does (or did?) Excel use for Bessel functions that is discontinuous at x=8?

It is clear that Microsoft Excel's implementation of the BesselJ function for $N=1$ is identical to this algorithm for arguments $X < 8$: ...
Rob Matson's user avatar
4 votes
Accepted

Floating point and global error in Euler Method

In a one-step method $$ y_{n+1}=y_n+h\Phi_f(x_n,y_n,h) $$ one gets a truncation error for the exact solution $$ y(x_{n+1})=y(x_n)+h\Phi_f(x_n,y(x_n),h)+h^{p+1}\tau(x_n) $$ For the error propagation of ...
Lutz Lehmann's user avatar
  • 5,984
4 votes

Efficiently estimating trace of a product of matrices

Edit Jan 12 I was pointed by the author of https://arxiv.org/abs/2010.09649 to this simple estimator of trace (explanation), which should also be better than the orthogonalization approach in the ...
Yaroslav Bulatov's user avatar
4 votes
Accepted

Kolmogorov n-width

Given the tags of your question I believe you are refererring to the rate of decay of the singular values of a SVD performed on a snapshot matrix of a full-order model. The general (not exhaustive) ...
Davide Papapicco's user avatar
4 votes
Accepted

How can we calculate mixed derivatives numerically using the Chebyshev derivative matrix?

Note: Your nomenclature is only valid on Cartesian elements. If you want to calculate derivatives on arbitrary shapes you also have to consider spatial metric terms. Answer: To keep it simple, we ...
ConvexHull's user avatar
  • 1,290
3 votes

Linear Least-Squares Point-to-Plane ICP degenerative case

This approach is the result of a Taylor approximation, which assumes that we are not very far from the solution (solution is the case when $R\approx I$ - no more updates can be made). Under large ...
Tolga Birdal's user avatar
  • 2,229
3 votes

How can I calculate the exponential integral?

As with most questions about the computation of special functions, the Digital Librarary of Mathematical Functions is a good place to start. In particular, see chapter 6, which deals with the ...
Brian Borchers's user avatar
3 votes

Solving a system of linear equations with only an approximate solution

It seems you are looking for an optimization (here, specifically a fit). You have some experimental data and you want to have a simple model explaining it. The simplest way is using the Ordinary ...
RFC 2549's user avatar
3 votes

Drawbacks of Newton-Raphson approximation with approximate numerical derivative

In the 1-dimensional case, there are three main methods which are similar to what you are describing which come to my mind. The secant method uses the derivative approximation $$f'(x_n)\approx\frac{f(...
Simply Beautiful Art's user avatar
3 votes
Accepted

Polynomial order of an approximation of a section of sine and numerical accuracy

By using orthonormal polynomial basis functions, then you do not need to solve a linear set of equations in order to get the polynomial coefficients, similar to the Fourier series coefficients. ...
fibonatic's user avatar
  • 450
3 votes

imaginary time propagation to find ground state wavefunction

It's a bit heavy, but not all of it must be read to get a useable method : Computing the ground state solution of Bose-Einstein condensates by a normalized gradient flow, Bao and Du. I believe -- it'...
Feffe's user avatar
  • 161
3 votes

Methods for fast approximation of convolution

Disclaimer: I'm new(er) to 'R' and so I don't know the sparse FFT library (SE,MIT,Berk) off the top of my head. This stuff has been published for ~2 years. I would be surprised if it doesn't exist - ...
EngrStudent's user avatar
3 votes

Efficiently estimating trace of a product of matrices

Your statistical method is pretty clever. This is less clever, but maybe you can build off the idea. For any matrix $A$, $(AA^T)_{ii}=\sum_m{A_{im}A_{im}}$, and $tr(AA^T)=\sum_i{||A_i||^2}$ where $||...
Charlie S's user avatar
  • 661
3 votes

Robust ways of evaluating $j_n(x+iy)/e^y$

The evaluation of $f(x) = e^{-\zeta}j_{n}(\sqrt{x^{2}-\zeta^{2}})$ should not run into numerical issues when using a verbatim translation of the formula for $x$ in $[0,10]$ and $10 \lt \zeta \lt 700$ ...
njuffa's user avatar
  • 1,865
3 votes

in Finite Element, which approximation requires less number of unknowns: B-splines vs Shape functions vs Spectral Elements

Based on the comments below your post you may reach the conclusion that # DOFs and speed have no correlation whatsoever - this is not true. Keeping all other things fixed and increasing the number of ...
lightxbulb's user avatar
  • 1,994
2 votes
Accepted

B-Splines Matlab Package

You may use Curve fitting toolbox which is provided by MATLAB. The function you need is spcol.
Xi Zou's user avatar
  • 56
2 votes

Chebyshev approximation by projection vs interpolation

Please don't downvote this answer just because it's incomplete. My intention is to let whoever answering my question build on it, rather than write from scratch. If your answer is more comprehensive ...
visitor's user avatar
  • 161

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