Questions tagged [function-approximation]

A function that implements an approximation solution for a problem. In general, the function approximation problem asks us to select a function among a well-defined class that closely matches ("approximates") a target function in a task-specific way

In computer science, they are many times that we can not compute something with full accuracy, because it's infinite. For example, in order to compute the value of cosine(π), we perform some approximation.

The function that would perform the computation of cosine(π) approximately is a function that uses approximation.

This tag should be used for problems that have to do with functions that implement an approximation solution for a problem.

Sometimes, these functions receive an ε parameter, which controls the approximation. Usually, ε, is called an approximation factor.

64 questions
1
vote
2 answers

taylor series with error at most 10^-3

I'm trying to calculate the the taylor series of cos(x) with error at most 10^-3 and for all x ∈ [-pi/4, pi/4], that means my error needs to be less than 0.001. I can modify the x +=in the for loop to have different result. I tried several numbers…
Mike
  • 56
  • 7
1
vote
0 answers

Choosing the active features for function approx with radial basis functions in reinforcement learning?

I don't understand how eligibility traces fit in with reinforcement learning when using radial basis functions (RBFs) to approximate the value function with continuous state variables. In particular, how do you decide which features are 'active'…
p-robot
  • 4,652
  • 2
  • 29
  • 38
1
vote
2 answers

Taylor Series Difference between exp(-x) and exp(+x)

I'm trying to write a program which calculates the Taylor series of exp(-x) and exp(x) up to 200 iterations, for large x. (exp(x)=1+x+x^2/2+...). My program is really simple, and it seems like it should work perfectly. However it diverges for…
khfrekek
  • 211
  • 1
  • 5
  • 12
1
vote
1 answer

How radial basis interpolation works?

Can any one explain to me how to understand this plot. This is 2D scatter data interpolation using Radial basis function. http://www.alglib.net/interpolation/introductiontorbfs.php In this link they shown this fig. but Don't understand what they…
jquery404
  • 653
  • 1
  • 12
  • 26
0
votes
1 answer

Fast but accurate trigonometric modulo range reduction for moderate magnitude inputs

So far I'm finding this answer regarding Approximate cosine to be highly accurate, better than other solutions I've come up with using minimax algorithm on different kernel domains, etc... but I'm running into an issue: sin() using this code seems…
0
votes
0 answers

Signal approximation with step functions

How to approximate the signal given by the blue line to get the red line as a result?. The red line is an example of the waveform I would like to obtain... Data: array([0.60051482, 0.52774704, 0.51047335, 0.3840505 , 0.23132447, 0.02007863,…
Rariusz
  • 73
  • 7
0
votes
0 answers

Tell WolframAlpha to show data field?

I'm trying to find an approximation for a function that's near y = x^(1/5). Unfortunately, polynomial approximations for functions below degree 1 don't work. These work if I specify the form manually, but are off by about 5% in the ranges I care…
0
votes
1 answer

how to approximate hyperbolic sine using its taylor series?

I'm trying to approximate hyperbolic sine. I need to do it without using math.h library functions. [don't provide me full solutions, just some hint, because I need to figure it out by myself] here's what I did: given the hyperbolic sine taylor…
0
votes
1 answer

How to correctly plot the error of a numerical algorithm in MATLAB

I would like to display the error made after the insertion of each approximation point in my numerical algorithm. Here is the plot that I get: I don't want to display the error like that, since it is not clear how the value of it changes after the…
Odess4
  • 420
  • 5
  • 17
0
votes
1 answer

What is the algorithm used for approximating trigonometric functions in RStudio?

I've tried the below code on RStudio and was expecting 0, 1 and 0.5 to show up. However, it showed a very small number instead of 0 and I thought it must be using some algorithm to approximate the sin function. sin(c(pi, pi/2, pi/6)) This was the…
0
votes
1 answer

Overflow when calculating gradient partial derivatives in Python

I made a def function in python where I could do simple gradient partial derivatives for updating variables in what is a very basic function approximation neural network without activation functions. This is for a single input x1 which tries to…
0
votes
0 answers

Error in function approximation (OverflowError: int too large to convert to float)

I have written a simple code to approximate exponential integral function (Ei function). This function has already been implemented in other libraries (like mpmath) but for some reasons, I do not want to use them. In this approximation there are…
Leo
  • 479
  • 2
  • 6
  • 16
0
votes
0 answers

Algorithm to approximate a unknown function with a given functional form?

Suppose i have a function f defined on the positives reals that i can only evaluate values from : for a given x, i have an algo that compute f(x) but that's it (and it's costly..) I want to approximate by another function $g$ with parameters a_i and…
lrnv
  • 1,038
  • 8
  • 19
0
votes
2 answers

Can shuffling my training data lead to bad model performance?

I am writing a neural network in C++ to approximate the xSin(x) function using a single hidden layer with 5 hidden neurons. The hidden neurons use tanh activation and the output layer uses Linear activation. I used 30 training examples for 10,000…
0
votes
0 answers

Approximation (fitting) method for an unknown function

I'm trying to approximate unknown function, given x and f(x) values. The function itself represents computational complexity of an algortihm, so it can be polynomial, logarithmic, exponential etc. I'm not sure whether such approximation method…