Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Contribution to a ploynomial

  1. Dec 5, 2007 #1
    Hello All,

    I'll outline what i'm trying to do: I've written a program which will fit a polynomial to a set of data. The data represents a spectra. I want to be able to fit a ploynomial to an experimental data set and then also fit several reference data sets(which i've been able to do. So i have a polynomial for the experimental data and several for the reference sets.

    What i want to do now is find out what combination of the reference polynomials wil best fit the experimental data set and therefore find the contribution of each reference to the final measured data. The problem is that the degree of each of the polynomials is not nesessarly the same.

    Any ideas? do i make myself clear?

  2. jcsd
  3. Dec 5, 2007 #2


    User Avatar
    Science Advisor
    Homework Helper

    If I understand the problem correctly, it comes down to the following

    E.g. if you have
    [tex]a_1(x^2 + 3x + 3) + a_2(2 x^2 - x ) + a_3 (4 x - 1)[/tex]
    and you want to match it to
    [tex]5 x^2 + 6 x - 3[/tex]
    Then you want to choose the coefficients such that ideally
    [tex]a_1 + 2 a_2 = 5, 3a_1 - a_2 + 4a_3 = 6, 3a_1 - a_3 = -3[/tex]
    or at least as close as possible.

    E.g. you can reduce your problem to solving a system of linear equations, or finding a best fit. There are probably tons of methods for them, though I must admit I know none.
  4. Dec 5, 2007 #3
    now why didn't i think of that!

    You understood correctly and i think it's going to work.
    Thanks a lot
  5. Dec 5, 2007 #4
    I think you want the idea of orthogonal (orthonormal) polynomials and projections.
  6. Dec 6, 2007 #5


    User Avatar
    Science Advisor
    Homework Helper

    Yeah, I was also thinking in terms of defining an inner product [tex]\langle \cdot, \cdot \rangle[/tex], and then decomposing as
    [tex]\sum \langle p_n, f \rangle p_n(x)[/tex]
    but I'm not sure if this would work if the set of reference polynomials wasn't orthogonal (probably it will be either incomplete or over complete at the very least, which means that the decomposition might not exist or not be unique) and not even which inner product to take for polynomials (the usual definition
    [tex]\langle f, g \rangle = \int_{-\infty}^\infty f(x) g(x) \, \mathrm dx[/tex]
    will certainly not work as the polynomials are not square integrable --- unless the domain is finite [edit]hmm, if the data represents a spectrum, it probably is bounded... so this might work? Still leaves the problem to determine how good a basis the set of reference polynomials is though[/edit]).

    I also have no idea how accurate the coefficient matching thing is, and how to get the best match if there is no exact solution for the system (e.g. there are more reference polynomials than the degree of the input function)
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook