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
2
votes
3 answers

python numpy (v1.15.0) fails to fit parabola

I'm having trouble understanding why is numpy having such a hard time fitting parabola to this data ? def make_poly(x, coefs): # generate a polynomial from an array of coefficients f = numpy.zeros(len(x)) for i in range(len(coefs)): …
Dusan Kojic
  • 339
  • 4
  • 11
2
votes
0 answers

Isolating a formula for a polynomial fit in r

This is a generalization of Isolating coefficients from polynomial fit in r (which does not cover the case of polynomials) and (in a sense) a duplicate of Isolating coefficients from polynomial fit in r (which, after 4 years, only has a partial…
jarauh
  • 1,836
  • 22
  • 30
2
votes
1 answer

Peak Curve Fitting in Python

I am trying to obtain, y, a function of x illustrated in the picture attached. I cannot obtain this function using polynomial fitting because of the peaking behavior. What is the best method for fitting the curve to obtain an equation whose output…
2
votes
1 answer

Nonconformant arguments lagrange polynomial (octave)

im working on octave not sure if it would run in matlab, im trying to do a simple lagrange polynomial that plot the points, the function and the lagrange aproximation, so i did the following, clear all clc function [y] = lagrange(x, x0, y0) n…
Zigisfredo
  • 123
  • 3
1
vote
2 answers

Polynomial approximation does not represent accurate approximation of line passing through data points in python

I am working on the task where I have to Augment the data. For data augmentation, I have to do polynomial approximation of the data (Non linear data). But if I do the polynomial approximation, I am not getting an accurate approximation of the…
1
vote
0 answers

how to show movie problem is also a NP hard Problem

I am working on an NP hard problem, here is the problem: " We need to either watch the movie or speak to friend and hear their recommendations about the movie. We only have t hours. " For this I need to design a polynomial-time algorithm for…
sow
  • 11
  • 1
1
vote
1 answer

Polynomial Regression in Poisson Regression

I want to create a model which takes values from a polynomial regression and creates a Poisson Regression based upon the predicted values (by polynomial). I only got the R code which would be something like this glm(y ~ poly(x, 6), family = Poisson,…
1
vote
0 answers

Sympy nsolve vs Mathematica NSolve for multivariate polynomial equations

An interesting feature regardin NSolve[] with Mathematica is that it seems to provide all the solutions it can find (and hopefully it is exhaustive). For instance, as stated in the examples: NSolve[{x^2 + y^3 == 1, 2 x + 3 y == 4}, {x, y}] would…
1
vote
0 answers

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 going on instead of using ready functions, however…
1
vote
1 answer

Approximating the sine function with polynomials using gaussian elimination

I'm trying to approximate the sine function over an interval with gaussian elimination using python. Using this code. from copy import deepcopy def convert_to_row_eschelon(A_, B_): A = deepcopy(A_) B = deepcopy(B_) dim = len(A) for…
1
vote
0 answers

Assistance in understanding what is being asked barycentric formula

i) Recall the general barycentric formula that computes the weights assuming unequally-spaced nodes (although we will be considering equally-spaced nodes, we will use the general formula to avoid taking factorials of very large numbers). Taking 0=−1…
mb88
  • 11
  • 1
1
vote
0 answers

Are there approximation formulae for the Jacobi Theta Functions?

I am looking for a complex-number approximation formula for the Jacobi Theta Functions that only uses simple functions. By simple, I mean supported natively by most programming languages and does not involve too many special functions as…
1
vote
0 answers

Fit a multivariate polynomial and get first derivatives in Python

I need some help working with multi-dimentional polynomials. Amost everyhting I find is 1-D. Let's say that I have the data z = [200, 250, 190, 180, 220] x = [100,101, 98, 92, 120] y = [5, 10, 15,22,8] where Z will be my dependent and X and Y are…
1
vote
1 answer

Should I use feature scaling with polynomial regression with scikit-learn?

I have been playing around with lasso regression on polynomial functions using the code below. The question I have is should I be doing feature scaling as part of the lasso regression (when attempting to fit a polynomial function). The R^2 results…
1
vote
1 answer

Fitting polynomials with degree>2 using fminunc

I am trying to find the coefficients for polynomials of degree n using fminunc. I know polyfit but I have to use fminunc (or lsqnonlin) because I need to extend my model at a later point. Anyway, my objective function is simply the nonlinear…
affitz
  • 171
  • 1
  • 5