Questions tagged [polynomial-approximations]

A polynomial approximation is an approximation of a real or complex function by a polynomial.

A polynomial approximation is an approximation of a real or complex by a polynomial.

Methods of polynomial approximation include the Taylor expansion, Chebyshev Polynomial approximation, and Lagrange polynomials.

82 questions
1
vote
2 answers

Train score diminishes after polynomial regression degree increases

I'm trying to use linear regression to fit a polynomium to a set of points from a sinusoidal signal with some noise added, using linear_model.LinearRegression from sklearn. As expected, the training and validation scores increase as the degree of…
1
vote
1 answer

Create vector of complete Chebyshev polynomials in Julia (or MATLAB)?

Suppose we have a two dimensional function f(x,y) we want to approximate with a set of Chebyshev polynomials up to degree 2. Let the Chebyshev polynomial of degree j be Tj(x) or Tj(y). We usually approximate f(x,y) by constructing a function g(x,y)…
1
vote
0 answers

N-dimensional high order polynomial interpolation

I am searching some clues about a complex issue that I am facing, regarding interpolation in a 4D space. I have a dataset composed by 340 points in a 3-dimensional space (I have three variables - A, B, C - each defined by 340 elements). Each point…
1
vote
1 answer

Multivariate polynomial approximation of a function in Maxima

I have long symbolic function in Maxima, let say fn(x,y):=<> I would like to calculate polynomial approximation of this function, let say fn_poly(x,y) within known range of x and y and with maximum error e I know,…
j123b567
  • 3,110
  • 1
  • 23
  • 32
1
vote
1 answer

Approximation Algorithm for Vertex Cover

If P is not equal to NP can it be shown that there is no approximation algorithm which comes within k of the optimal vertex cover, where k is a fixed constant?
1
vote
1 answer

Custom changes to polynomial function (polynom) for a variable in R

This question is more for my own curiosity. I was looking through the Polynom documenation pdf for R, and noticed several basic polynomial operations such as: p <- poly.calc(1:5) ## -120 + 274*x - 225*x^2 + 85*x^3 - 15*x^4 + x^5 However, how would…
Derek_M
  • 1,018
  • 10
  • 22
1
vote
1 answer

Fitting a n ordered polynomial

I was trying to plot a regression curve: coef_fit = polyfit(norm_dist,norm_time,7); y_fit = polyval(coef_fit,xlim); plot(xlim,y_fit,'r'); But it is always plotting a line respective of the order I pass.
1
vote
1 answer

How to find the points where a polynomial fit passes through zero

I've fit a 4th order polynomial curve to my data like so: y<-c(-13,16,35,40,28,36,43,33,40,33,22,-5,-27,-31,-29,-25,-26,-31,-26,-24,-25,-29,-23,4) x<-1:24 #4th order polynomial…
1
vote
1 answer

Draw an approximation curve for a given data points in Opencv

Is Opencv is capable of drawing an approximation curve for given data points which might have noise? Do I need to implement that approximation function separately?
Shyam
  • 21
  • 5
1
vote
1 answer

Whats wrong with my Hermite Interpolation in Fortran?

Hermite Interpolation woes I am trying to find the Newton Dividing Differences for the function and derivative values of a given set of x's. I'm running into serious problems with my code working for tiny examples, but failing on bigger one's. As is…
1
vote
2 answers

Why is this polynomial equation badly conditioned?

I have 1x1024 matrix. So I'd like to estimate a polynomial equation. X= (0:1023)' Y= acquired data. A 1024 element vector Then I try this in MATLAB: polyfit(x,y,5) But MATLAB makes an abnormal result with warning. Warning: Polynomial is badly…
bural
  • 45
  • 1
  • 7
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
1 answer

Simplify a trigonometric expession with Mathematica

I would need to simplify or approximate this expression: Abs[0.00178442 Cos[alpha] - 0.0368414 Sin[alpha] + (0.998216 Cos[alpha] + 0.0368414 Sin[alpha]) (Cos[2 dx] + I Sin[2dx])]^4 I have tried with the Expand and Simplify/FullSimplify commands in…
0
votes
1 answer

(Cephes) Approximation of log1p

The Cephes implementation of log1p is described in the documentation as Coefficients for log(1+x) = x - x**2/2 + x**3 P(x)/Q(x) where P(x) and Q(x) are two polynomials (with Q(x) a monic polynomial. This is partially the Maclaurin series for log(1…
John
  • 395
  • 1
  • 7
  • 23
0
votes
0 answers

Polynomic approximation with gradient descent

As i wrote following example of polynom approximation, using MSE and backprop: import numpy as np import matplotlib.pyplot as plt x = np.array([1,2,3,4,5]) y = np.array([5,15,25,45,65]) grade = 3 def interpolate_backprop(x,y,grade,alfa=1e-4,…