Questions tagged [polynomials]

In mathematics, a polynomial is an expression consisting of variables (or indeterminates) and coefficients, that involves only the operations of addition, subtraction, multiplication, and non-negative integer exponents.

In mathematics, a polynomial is an expression consisting of variables (or indeterminates) and coefficients, that involves only the operations of addition, subtraction, multiplication, and non-negative integer exponents.

An example of a polynomial of a single indeterminate (or variable), x, is x2 − 4x + 7, which is a quadratic polynomial.

Polynomials appear in a wide variety of areas of mathematics and science. For example, they are used to form polynomial equations, which encode a wide range of problems, from elementary word problems to complicated problems in the sciences; they are used to define polynomial functions, which appear in settings ranging from basic chemistry and physics to economics and social science; they are used in calculus and numerical analysis to approximate other functions. In advanced mathematics, polynomials are used to construct polynomial rings and algebraic varieties, central concepts in algebra and algebraic geometry.

Wikipedia: http://en.wikipedia.org/wiki/Polynomial

978 questions
6
votes
4 answers

How to detect in real time a "knee/elbow" (maximal curvature) in a curve

In the following curve (blue line) I'm trying to detect the "knee/elbow" which should be located around x = 2.5 This is the set of values I'm using: x = {-10, -9, -8, -7, -6, -5, -4, -3, -2 , -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} y = {0, 10, 20,…
Marco
  • 391
  • 4
  • 18
6
votes
1 answer

Export fitted regression splines (constructed by 'bs' or 'ns') as piecewise polynomials

Take for instance the following one-knot, degree two, spline: library(splines) library(ISLR) fit.spline <- lm(wage~bs(age, knots=c(42), degree=2), data=Wage) summary(fit.spline) I see estimates that I don't expect. Coefficients: …
shide
  • 63
  • 1
  • 7
6
votes
3 answers

Function for polynomials of arbitrary order (symbolic method preferred)

I've found polynomial coefficients from my data: R <- c(0.256,0.512,0.768,1.024,1.28,1.437,1.594,1.72,1.846,1.972,2.098,2.4029) Ic <- c(1.78,1.71,1.57,1.44,1.25,1.02,0.87,0.68,0.54,0.38,0.26,0.17) NN <- 3 ft <- lm(Ic ~ poly(R, NN, raw = TRUE)) pc <-…
user4489658
6
votes
1 answer

High (or very high) order polynomial regression in R (or alternatives?)

I would like to fit a (very) high order regression to a set of data in R, however the poly() function has a limit of order 25. For this application I need an order on the range of 100 to 120. model <- lm(noisy.y ~ poly(q,50)) # Error in poly(q, 50)…
CenturionSC2
  • 83
  • 1
  • 7
6
votes
1 answer

When can the Master Theorem actually be applied?

I am quite frustrated over this. In CLRS 3rd edition, page 95 (chapter 4.5), it mentions that recurrences like T(n) = 2T(n/2) + n lg n cannot be solved with the Master Theorem because the difference f(n)/n^(log_b(a)) = (n lg n)/n^1 = lg n is not…
AJJ
  • 2,004
  • 4
  • 28
  • 42
6
votes
3 answers

List of coefficients to polynomial

How do I create a polynomial out of a list of coefficients in SymPy? For example, given a list [1, -2, 1] I would like to get Poly(x**2 - 2*x + 1). I tried looking at the docs but could not find anything close to it.
Ecir Hana
  • 10,864
  • 13
  • 67
  • 117
6
votes
1 answer

How to analyse a sparse adjacency matrix?

I am researching sparse adjacency matrices where most cells are zeros and some ones here-and-there, each relationship between two cells has a polynomial description that can be very long and their analysis manually time-consuming. My instructor is…
hhh
  • 50,788
  • 62
  • 179
  • 282
6
votes
2 answers

numpy calculate polynom efficiently

I'm trying to evaluate polynomial (3'd degree) using numpy. I found that doing it by simpler python code will be much more efficient. import numpy as np import timeit m = [3,7,1,2] f = lambda m,x: m[0]*x**3 + m[1]*x**2 + m[2]*x + m[3] np_poly =…
mclafee
  • 1,406
  • 3
  • 18
  • 25
5
votes
1 answer

Plotly: How to add polynomial fit line to plotly go.scatter figure using a DASH callback?

I'd like to add a polynomial curve to a scatter plot that is rendered using a callback. Following is my callback function which returns the scatter plot. @app.callback(Output('price-graph', 'figure'), [ Input('select',…
kms
  • 1,810
  • 1
  • 41
  • 92
5
votes
1 answer

How to speed up the expansion of very large polynomials in sympy?

I am working with very large polynomials in sympy and I need to have them in expanded form to find certain terms and coefficients. However, the expansion of these polynomials takes a long time. Is there a fast way to expand polynomials or get…
user10569221
5
votes
1 answer

Log2 approximation in fixed-point

I'v already implemented fixed-point log2 function using lookup table and low-order polynomial approximation but not quite happy with accuracy across the entire 32-bit fixed-point range [-1,+1). The input format is s0.31 and the output format is…
Ali
  • 288
  • 3
  • 10
5
votes
1 answer

time-series in ggplot using geom_line

I'm relatively new to gganimate and I'm trying to create a simple polynomial time-series graph on R studio. x <- 1:100 f <- function (x){ return(-(x)^2) } df <- data.frame(x, y= -(x)^2) ggplot(df, aes(x, y)) + geom_line() + …
flustercludge
  • 77
  • 1
  • 7
5
votes
1 answer

How to exclude values from a polynomial fit?

I fit a polynomial to my data, as shown in the figure: Using the script: from scipy.optimize import curve_fit import scipy.stats from scipy import asarray as ar,exp xdata = xvalues ydata = yvalues fittedParameters = numpy.polyfit(xdata, ydata +…
D.Kim
  • 151
  • 3
  • 10
5
votes
2 answers

Naive Recursive Algorithm for Polynomial Multiplication in Python

I am trying to implement the divide-and-conquer algorithm for polynomial multiplication. Here is the pseudocode given in the lecture notes: where A, B are lists of coefficients of each polynomial, n is the size of the problem (degree - 1) and a_l,…
5
votes
1 answer

Yun's algorithm

I would like to try to implement Yun's algorithm for square-free factorization of polynomials. From Wikipedia (f is the polynomial): a0 = gcd(f, f'); b1 = f/a0; c1 = f'/a0; d1 = c1 - b1'; i = 1 repeat ai = gcd(bi, di); bi+1 = bi/ai; ci+1 = di/ai; i…
minmax
  • 493
  • 3
  • 10
1 2
3
65 66