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
function-approximation
64
questions
1
vote
1
answer
33
views
Using the approx function for several variables within 2 groups
I have a dataframe 'd' in which sex is 1/2 and age in days is 746 (~24.5 months) or 776 (~25.5 months)
d = structure(list(sex = c(1L, 1L, 2L, 2L), agemos = c(24.5, 25.5, 24.5, 25.5),
l = c(-0....
0
votes
1
answer
316
views
Sine curve to fit data cloud using C++
Consider:
Curve fit using Python SciPy
I'm trying to find an algorithm to fit a sine curve into a data set. This is quite simple using Python SciPy, but now I have to bring the whole algorithm to an ...
0
votes
1
answer
114
views
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 ...
2
votes
1
answer
49
views
R: approxfun() only returns first observation of y
EDIT: The solution is simple. As Miff points out, I'm using values of x that are too low. I suppose I might leave the question up for the next person who makes this mistake.
I'm attempting to use the ...
1
vote
1
answer
168
views
Using Python to find best square approximation of Piecewise Functions?
Given a parabola, $f(x)=10(x-1)^2-1,x\in \Omega =[1,2]$, find the best approximation in the space of all linear functions. The Python code is as follows:
import sympy as sym
import numpy as np
import ...
1
vote
1
answer
310
views
How to find the true Q-value and overestimation bias in actor critic
I am trying to plot the overestimation bias of the critics in DDPG and TD3 models.
So essentially there is a critic_target and a critic network.
I want to understand how does one go about finding the ...
0
votes
1
answer
283
views
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 ...
0
votes
1
answer
105
views
How to correctly plot the error of a numerical algorithm in MATLAB [duplicate]
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 ...
2
votes
0
answers
109
views
Convergence guarantee of Policy Gradient with function approximation
Is there any convergence proof of the Policy Gradient algorithm with "general" value/Q function approximation ?
Seminal papers (Sutton1999 & Tsitsiklis1999) prove the theorem using a ...
1
vote
0
answers
980
views
Polynomial interpolation in python
I am studying function approximation and while trying to understand/implement polynomial interpolation I've found an example here. I find the code below a good example to understand what is actually ...
0
votes
1
answer
130
views
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 ...
1
vote
1
answer
70
views
How do you find an equation of a plane that best approximates 3 dimensional data in MATLAB?
I have the following 3 dimensional data in MATLAB:
tau = [6e-9 30e-12 6e-9 30e-12];
E=[1e-3 50e-6 .01 1e-3];
k=[6.93774E-08 1.23666E-08 4.45261E-08 1.90789E-08];
plot3(tau, E, k,'*'); xlabel('tau (s)')...
1
vote
2
answers
571
views
np.sum does not return exact summation [duplicate]
Consider the following numpy vector of number:
a = np.array([.1, .2, .2, .2, .2, .1])
Obviously, the sum of these numbers gives 1. However, when computing
b = np.sum(a)
I get
print (b)
0....
0
votes
1
answer
219
views
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. ...
1
vote
1
answer
40
views
Is this example of off policy correct?
I am reading Sutton and Barto and want to make sure I am clear.
For Off Policy learning can we think of a robot in a particular terrain - say on sand - as the target policy but use the robot's policy ...