Skip to main content
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,981
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

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

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

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,895
6 votes

Benchmark Neural Networks on High-Dimensional Functions

A quick answer. In 2013, Derek Bingham and his student Sonja Surjanovic created a list of multi-d test functions for uncertainty quantification methods by reviewing existing literature. https://www....
Paul G. Constantine'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,165
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
  • 831
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
  • 6,129
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

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
  • 6,129
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,443
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

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

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,239
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
  • 470
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

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,895
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
  • 2,197
3 votes

Benchmark Neural Networks on High-Dimensional Functions

(My answer didn't fit in the little box, so here's another big box answer.) I think your notion of "application" is too abstract. An application is a science or engineering field where a ...
Paul G. Constantine's user avatar
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
2 votes

Matching/Assignment Problem

You don't say what is the condition when an inventory draw is allowed to match a sale, but I'm going to assume it is: both the timestamp and the item must match, if we want a particular sale to be ...
D.W.'s user avatar
  • 477
2 votes

Which are some good algorithms and heuristics to calculate the similarity between two matrices?

The short answer is: "it depends". But the first question that is not entirely clear from the question is a definition of similarity between two matrices. Technically there is a term Matrix ...
Anton Menshov's user avatar
  • 8,702
2 votes
Accepted

Slightly change two vectors to satisfy a constraint

There are of course infinitely many vectors $\vec \alpha,\vec \beta$ that satisfy $\vec \alpha\cdot\vec \beta=c$. So if you want to have a particular pair of vectors, you will have to be precise when ...
Wolfgang Bangerth's user avatar
2 votes
Accepted

Improving function approximation with neural network

Most likely, you have the problem set up correctly and just need to adjust various things. What is the scale for altitude? You probably want to normalize it if you haven't already, especially since ...
Taw's user avatar
  • 136

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