Questions tagged [approximation]
A method of finding nearly-optimal solutions to a problem. Generally, this terminology is applied to algorithms and heuristics for solving NP-Hard problems in computer science.
109
questions
2
votes
1
answer
211
views
Shape functions on the triangle using vertex values and derivatives
Is it possible to approximate a function over a 2-d triangle $\mathcal{T}$ with vertexes $\mathbf{p}_1, \mathbf{p}_2, \mathbf{p}_3$, assuming that we know the values $f(\mathbf{p}_i)$, gradient $\...
5
votes
3
answers
191
views
Benchmark Neural Networks on High-Dimensional Functions
For a personal project, I am interested in benchmarking certain neural network architectures in the context of high-dimensional function approximation. Specifically, I am interested in continuous, ...
2
votes
0
answers
42
views
Are there standard methods for joining a numerical function approximation to its asymptotic behavior?
I'm working on an algorithm for computing a function that is a generalization of the Voigt profile. The Voigt profile is the convolution of a Cauchy (aka Lorentzian) probability density function (PDF) ...
1
vote
0
answers
59
views
Finite volume method for a general flux
How to approximate flux 𝐹(𝑢)⋅𝑛 where 𝑛 denotes the unit normal outward when using finite volumes?
in my case it's not a conservation law so my question is how can we approximate the final term
\...
0
votes
0
answers
70
views
How should I calculate the residuals of my numerical PDE solution?
I solved numerically the following wave equation with a source problem:
$$ u_{rr} + {1 \over r}u_r + u_{zz} = {1 \over c^2}u_{tt} + s(r,z,t) \tag 1 $$
$$ u_r(0,z,t) = 0 \tag 2$$
$$ u_r(r_{max},z,t) = ...
1
vote
1
answer
175
views
How to approximate the flux when using finite volumes?
How to approximate flux $F(u)\cdot n$ where $n$ denotes the unit normal outward when using finite volumes?
$$\int_{\sigma} F(u) \cdot \boldsymbol{n}_{K, \sigma} \mathrm{d} \gamma(x)$$
3
votes
1
answer
181
views
How can we calculate mixed derivatives numerically using the Chebyshev derivative matrix?
Using the Chebyshev derivative matrix $D$, we can numerically approximate the first and second derivative of a function by doing matrix multiplication:
$${df(x) \over dx} = Df(x) \tag 1$$
$${d^2f(x) \...
0
votes
0
answers
39
views
What is the minimum error achievable using gaussian process emulation?
I am interested in using Gaussian processes as emulators for other computational models, and I would like to characterize the expected numerical precision of the emulator.
Specifically, how small can $...
1
vote
1
answer
126
views
in Finite Element, which approximation requires less number of unknowns: B-splines vs Shape functions vs Spectral Elements
In Finite Element Analysis, one requires to approximate the solution in terms of basis functions. My questions is, which method in general is better? by 'better', I mean which involves less number of ...
6
votes
1
answer
218
views
How to optimize an approximated matrix multiplication?
[UPDATING]
The old one is a simplified version of the current one. Here is a solution based on the answer proposed by professor Bangerth down below. To describe what I am trying to do, first rewrite ...
12
votes
2
answers
1k
views
Faster Logistic Function
I've noticed that a fairly significant number of cycles in one of my programs are being consumed by the logistic function:
$$f(x)=\frac{1}{1+e^{-x}}$$
Is there a good approximation I can use to reduce ...
1
vote
1
answer
733
views
Kolmogorov n-width
Could someone please point me to an understandable definition of the Kolmogorov n-width? I'm having a hard time figuring out what is the output of the definition - is it an integer?
Edit: I realize ...
1
vote
1
answer
808
views
Finding the parameters of a function via curve fit
I'm trying to estimate the parameters (v, n, k) defined in fit_func. I tried the default least squares fit but I couldn't find the parameters successfully.
...
0
votes
0
answers
659
views
Curve fitting using a piecewise polynomial
I am trying to fit a piecewise polynomial function
Code:
...
1
vote
0
answers
42
views
Integral from function approximations
I have some data which I cannot manage to model and fit with a known function, so let’s say that they are a sample from the unknow function $f(x)$, which look a sort of skewed bell-shaped distribution....
2
votes
0
answers
56
views
Estimating $n$ column norms of $A$ by using less than $n$ calls to $Ax$?
Suppose I have an $m \times n$ matrix $A$ that is only accessible through matrix-vector products $Ax$. These are expensive, is there a way to approximate vector $x$ of $n$ column norms of $A$ by using ...
3
votes
1
answer
87
views
Robust ways of evaluating $j_n(x+iy)/e^y$
For reasons to do with extending the range of applicability of this Mathematica package, I would like to have a good handle on the numerical evaluation of functions of the form
$$
f(x) = \frac{j_n(\...
9
votes
2
answers
660
views
Efficiently estimating trace of a product of matrices
I have $d\times d$ real-valued matrices $A_1,\ldots,A_k$, $1000<d<4000$, $k\approx 50$, and need to estimate the trace of the following matrix product
$$t=\text{tr}(A_1 A_2\cdots A_k A_k^T \...
6
votes
1
answer
244
views
General approach to infinite sums
My question is specific to algorithms and models of computation.
I would like to write code to evaluate the following expression quickly and accurately:
$$\log \left( \sum_{i=1}^{\infty}{I_{\nu+i}(2\...
1
vote
0
answers
143
views
Fast evaluation of trigonometric polynomials
Suppose you have a trigonometric polynomial of the form
\begin{equation*}
x(t) = \sum_{k = 0}^N a_k \cos(2 \pi k f_0 t).
\end{equation*}
Using Clenshaw algorithm, one can evaluate this polynomial in $...
1
vote
0
answers
84
views
elementwise function of low rank approximation
I recently ran into an interesting result.
I have a matrix $D$ containing pairwise distances between all points in a dataset. This matrix is converted to a similarity matrix $S$ via an RBF kernel.
...
1
vote
1
answer
206
views
Improving function approximation with neural network
I am building a neural network to approximate a data set which takes 3 inputs and gives 1 output. After testing the network using a few different iterations of hidden layers and adjusting optimizers ...
0
votes
0
answers
170
views
Boundary conditions for an FEM approximation of the Laplace operator
Using FEM, I want to approximate the Laplacian
$$u = \nabla \cdot \nabla h \, ,$$
where $h(x,y)$ is an FEM approximated scalar field on the same mesh, i.e. piecewise differentiable.
I am using MOOSE ...
5
votes
1
answer
427
views
Floating point and global error in Euler Method
Inspired by this answer, I tried to understand when floating point errors come into visibility and to check it also comparing the plot of the numerical solution with Explicit Euler with the analytical ...
3
votes
1
answer
78
views
Is there a source/cookbook of equations that approximate geometric shapes?
I'm numerically modelling flows around various geometric 2D shapes. Is there a good source/cookbook of equations that approximate these? Some examples are
Rectangle:
$(x-a)^n+(y-b)^n < r^n$ where ...
4
votes
0
answers
63
views
Continuous limit and nonlinear functional analysis
I have a kind of general question about approximation schemes in nonlinear functional analysis. Given a nonlinear map $\Phi$ from an open set (in an infinite dimensional Banach space) of functions to ...
1
vote
0
answers
100
views
Error curve does not oscillate in between reference points using Remez
Using the Remez algorithm, implemented using multi-precision library, in certain functions that I want to approximate, the error curve does not oscillate in between reference points, and so no roots ...
3
votes
1
answer
116
views
Linearization of Remez algorithm rational case
In the rational case, we are interested to find polynomials $P(x)$ and $Q(x)$ s.t.
$f(x_k)-P(x_k)/Q(x_k)=(-1)^kE$ for $k=1,2,\ldots, N$ where $N=deg(P)+deg(Q)+2$
This can be rewritten as
$$
(1)~~~~~~(...
1
vote
1
answer
79
views
Questions on Daubechies wavelets
Is the refinement equation for the orthonormal Daubechies scaling function
$$\phi(x) = \sqrt{2} \sum_n h_n \phi(2x-n) \;?$$
The filter coefficients for Daubechies wavelets have been given e.g. in
this ...
3
votes
0
answers
229
views
Remez algorithm convergence
I have implemented the Remez algorithm in Python where all calculations were done with the Python mpmath library. I have noticed that sometimes the $|E_{max}|$ and $|E_{min}|$ do not monotonically ...
3
votes
3
answers
704
views
What are some algorithms to calculate the width of an arbitrary polygon when a bounding box approximation is inaccurate
What are some alternative algorithms to creating a bounding box for finding the max width of a concave, simple winding polygon, like the one in the below image? I prefer solutions that are more ...
2
votes
1
answer
2k
views
what is non-asymptotic convergence?
I guess convergence in general means it is in asymptotic sense but what does non-asymptotic convergence mean?. Can someone please explain with an example?
2
votes
0
answers
39
views
Fast approximate evaluation of Fourier-Legendre series
Suppose I know that a function from $[0,\pi] \to \mathbb{R}$ may be written as
$$
\sum_{k=0}^\infty A_l \frac{2l+1}{4\pi} P_l(r)
$$
where $A_l$ all are known. Is there a way in which I may very ...
0
votes
2
answers
348
views
How can I calculate the exponential integral?
(I originally asked this in a different exchange.)
I'm writing a program that uses the prime-counting function. Right now, I'm using x/log(x), but I want to ...
5
votes
1
answer
101
views
approximate function such that the inverse of the approximation is "simple"
I have a smooth enough injective function $f:[a, b]\to \mathbb{R}$ which I want to approximate by something that can be computed quickly, e.g., a Padé approximant of low degree,
$$
\frac{\sum_{j=0}^m ...
4
votes
0
answers
102
views
Fast approximate solver for vehicle routing problem
I need to solve capacitated asymmetrical vehicle routing problem with time windows on ~30k points. Time limits for calculations are 2 hours. I've tried using Clarke and Wright savings algorithm, it is ...
4
votes
0
answers
265
views
MATLAB: Compute the Schwarz-Christoffel transformation symbolically
Suppose we have a conformal mapping from the unit disk in the $\omega$ plane onto the exterior of a polygon in the $z$ plane.
The Schwarz-Christoffel mapping in this case is defined as:
$$f(u) = A - ...
8
votes
1
answer
337
views
Size of jump for piecewise discontinuous approximations
If one has a sufficiently smooth function $u$ that is approximated by a piecewise constant function $u_h=\Pi^0_h u$ on a mesh of cell size $h$ (where $\Pi^0_h$ is the $L_2$ projection onto the ...
0
votes
1
answer
47
views
Slightly change two vectors to satisfy a constraint
$\vec{a}\cdot\vec{b} \approx c$
$\vec{\alpha} \cdot \vec{\beta} = c$
$\vec{\alpha}$ is close to $\vec{a}$ and $\vec{\beta}$ is close to $\vec{b}$
Given $\vec{a}$, $\vec{b}$ and c, how to find $\vec{\...
8
votes
1
answer
480
views
What algorithm does (or did?) Excel use for Bessel functions that is discontinuous at x=8?
Writing this comment reminded me of something I noticed years ago about evaluating Bessel functions of the first kind $J_n(x)$ in Excel. (BESSELJ)
I don't use Excel now but at the time I'd checked ...
2
votes
0
answers
78
views
Weighted Set Cover in practice, beyond the greedy algorithm
According to the wikipedia page for Set Cover, the greedy algorithm for weighted set cover achieves the polynomial-time approximation bound. There are other techniques for solving Set Cover, such as ...
1
vote
1
answer
196
views
Approximation of a non linear problem with python
I need your help to solve a problem I'm working on for school.
My goal is to approximate the coefficients of a weight matrix so that they check particular properties.
So I have $W$ the weight matrix ...
3
votes
2
answers
300
views
Image hash similarity matching possible?
I have the following question:
We have two face image files (JPEG), a Matrix of $128\times 128$ with values between 0-255.
We would like to hash both image files using a function $f(x, key)$. Where I ...
4
votes
1
answer
210
views
Taylor expansion of error - Finite elements approximation
In some of my computations I calculate a scalar value $\lambda_h$ (in my case an eigenvalue) depending on a finite element discretization of the domain. Usually we can manage to find estimates of the ...
0
votes
1
answer
100
views
Which are some good algorithms and heuristics to calculate the similarity between two matrices?
Say I have a matrix like this:
\begin{bmatrix}
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 1 \\
0 & 1 & 1 & 1 \\
\end{bmatrix}
And this one:
\begin{bmatrix}
...
0
votes
1
answer
300
views
Linear Least-Squares Point-to-Plane ICP degenerative case
I'm trying to implement Linear Least-Squares Optimization for Point-to-Plane ICP Surface Registration
Paper describes linear approximation for point to plane distance for rigid ICP. This approach is ...
0
votes
1
answer
146
views
Chebychev Polynomial derivatives at zero points and extreme points
I was looking for some help with derivatives of Chebychev polynomials at zero points. The recursive expression,
$$
T_{(j+1)}(x) = 2xT_j(x) - T_{(j-1)}(x)
$$
has the derivative
$$
T'_{j+1}(x) = 2T_j(...
0
votes
1
answer
4k
views
Derivatives of a Chebychev polynomial
I am using Chebychev collocation nodes for approximation, and my problem requires me to calculate derivatives of the polynomial. I have been reading from a few sources, but I am not sure I understand ...
1
vote
0
answers
70
views
Computing dilogarithm
I'm measuring the integral of a quantity which, mathematically, requires the computation of a dilogarithm function.
$$\operatorname{Li}_2(be^{ax})$$
where $b$ and $a$ (are real and) can be positive ...
0
votes
1
answer
317
views
B-Splines Matlab Package
I'm looking for a good Matlab package/library for B-Splines approximation. Ideally, it would take knots $t_1, \ldots , t_n$, and data points $g(t_1),\ldots , g(t_n)$, and Produce $$Vg :\,= \sum\...