When fitting a polynomial to data points, how to determine the reasonable degree to use?Linear regression for minimizing the maximum of the residualsFitting for piecewise function, with constraints on first/second derivativeIntuitive proof of interpolation polynomial existenceFor a fixed degree, is there always a Lagrange polynomial below the original function?Optimal place to measure for simple linear regression/fittingInterpolation of Symmetric DataProving that $R^2to 1$ as the degree of a polynomial $kto infty$ for a least squares regression.Is it Possible to Linearise the Bounded Growth Model to use LLSQ?Why isn't the linear regression coefficient not just the average vector to data points?How to feed data into a polynomial basis function regression (unregularized) for degree n?

Smoothness of finite-dimensional functional calculus

What do you call a Matrix-like slowdown and camera movement effect?

What is the offset in a seaplane's hull?

What do the dots in this tr command do: tr .............A-Z A-ZA-Z <<< "JVPQBOV" (with 13 dots)

If I cast Expeditious Retreat, can I Dash as a bonus action on the same turn?

How old can references or sources in a thesis be?

What are these boxed doors outside store fronts in New York?

What would happen to a modern skyscraper if it rains micro blackholes?

Theorems that impeded progress

Are the number of citations and number of published articles the most important criteria for a tenure promotion?

What does it mean to describe someone as a butt steak?

How much RAM could one put in a typical 80386 setup?

How to test if a transaction is standard without spending real money?

I’m planning on buying a laser printer but concerned about the life cycle of toner in the machine

Accidentally leaked the solution to an assignment, what to do now? (I'm the prof)

Service Entrance Breakers Rain Shield

Why are electrically insulating heatsinks so rare? Is it just cost?

Prove that NP is closed under karp reduction?

Languages that we cannot (dis)prove to be Context-Free

Today is the Center

How is the claim "I am in New York only if I am in America" the same as "If I am in New York, then I am in America?

Test whether all array elements are factors of a number

can i play a electric guitar through a bass amp?

How did the USSR manage to innovate in an environment characterized by government censorship and high bureaucracy?



When fitting a polynomial to data points, how to determine the reasonable degree to use?


Linear regression for minimizing the maximum of the residualsFitting for piecewise function, with constraints on first/second derivativeIntuitive proof of interpolation polynomial existenceFor a fixed degree, is there always a Lagrange polynomial below the original function?Optimal place to measure for simple linear regression/fittingInterpolation of Symmetric DataProving that $R^2to 1$ as the degree of a polynomial $kto infty$ for a least squares regression.Is it Possible to Linearise the Bounded Growth Model to use LLSQ?Why isn't the linear regression coefficient not just the average vector to data points?How to feed data into a polynomial basis function regression (unregularized) for degree n?













0












$begingroup$


I have wondered the following: Suppose that there is a set of data points $(x_i,y_i)$. Then I would like to know if it is more reasonable to assume if there is a polynomial relation of degree $m$ between them or of degree $n$. Is there way to measure it? I know that Lagrange's polynomial gives the exact relation but for example physics formula $F=ma$ says that sometimes it is correct to choose linear polynomial to model the phenomenon.










share|cite|improve this question











$endgroup$











  • $begingroup$
    See Uniqueness of the interpolating polynomial
    $endgroup$
    – Weaam
    Oct 28 '15 at 20:16















0












$begingroup$


I have wondered the following: Suppose that there is a set of data points $(x_i,y_i)$. Then I would like to know if it is more reasonable to assume if there is a polynomial relation of degree $m$ between them or of degree $n$. Is there way to measure it? I know that Lagrange's polynomial gives the exact relation but for example physics formula $F=ma$ says that sometimes it is correct to choose linear polynomial to model the phenomenon.










share|cite|improve this question











$endgroup$











  • $begingroup$
    See Uniqueness of the interpolating polynomial
    $endgroup$
    – Weaam
    Oct 28 '15 at 20:16













0












0








0





$begingroup$


I have wondered the following: Suppose that there is a set of data points $(x_i,y_i)$. Then I would like to know if it is more reasonable to assume if there is a polynomial relation of degree $m$ between them or of degree $n$. Is there way to measure it? I know that Lagrange's polynomial gives the exact relation but for example physics formula $F=ma$ says that sometimes it is correct to choose linear polynomial to model the phenomenon.










share|cite|improve this question











$endgroup$




I have wondered the following: Suppose that there is a set of data points $(x_i,y_i)$. Then I would like to know if it is more reasonable to assume if there is a polynomial relation of degree $m$ between them or of degree $n$. Is there way to measure it? I know that Lagrange's polynomial gives the exact relation but for example physics formula $F=ma$ says that sometimes it is correct to choose linear polynomial to model the phenomenon.







regression interpolation mathematical-modeling






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Oct 28 '15 at 21:25







user147263

















asked Oct 28 '15 at 20:04









studentstudent

1




1











  • $begingroup$
    See Uniqueness of the interpolating polynomial
    $endgroup$
    – Weaam
    Oct 28 '15 at 20:16
















  • $begingroup$
    See Uniqueness of the interpolating polynomial
    $endgroup$
    – Weaam
    Oct 28 '15 at 20:16















$begingroup$
See Uniqueness of the interpolating polynomial
$endgroup$
– Weaam
Oct 28 '15 at 20:16




$begingroup$
See Uniqueness of the interpolating polynomial
$endgroup$
– Weaam
Oct 28 '15 at 20:16










1 Answer
1






active

oldest

votes


















0












$begingroup$

Part of the issue is whether you want your function to fit the data "as closely as possible", or if you want it to hit every data point exactly.



For example, if you want to fit some data that appears linear, using linear least squares approximation to find the two coefficients which minimize the error is the right way to go. However, if you want an exact estimate, you might want to look at Lagrange Interpolation.



It sounds like you want a "close as possible fit", but you want to compare the accuracy of Polynomials of different degrees. You can use least squares techniques to find the coefficients of a polynomial of a given degree. To do this, you will use a matrix containing powers of your data points and a vector containing your coefficients.



Say we have d data points, and we want a degree n polynomial. Then our matrix will have d rows and n+1 columns. The ith row contains the powers, 0 through n, of the ith data point. The vector contains the constant, then the linear coefficient, and so on.



Multiplying the matrix and the vector gives you a vector of dimension d. (Independent of the degree of the polynomial used!) Typically we use these objects to minimize the error, but once you have the best coefficients for a given degree, you can multiply the matrix by the coefficient vector, and finally subtract the vector containing the y-values. The norm of this vector (X Powers)*(Coefs) - (Y data) is the square root of the sum of the squares of the error at each data point.



If you find this norm for several different degrees, you can find the degree polynomial with the lowest error, and that should be the closest approximation for the degrees tested.



Best of luck!






share|cite|improve this answer









$endgroup$













    Your Answer





    StackExchange.ifUsing("editor", function ()
    return StackExchange.using("mathjaxEditing", function ()
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    );
    );
    , "mathjax-editing");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "69"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f1502316%2fwhen-fitting-a-polynomial-to-data-points-how-to-determine-the-reasonable-degree%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0












    $begingroup$

    Part of the issue is whether you want your function to fit the data "as closely as possible", or if you want it to hit every data point exactly.



    For example, if you want to fit some data that appears linear, using linear least squares approximation to find the two coefficients which minimize the error is the right way to go. However, if you want an exact estimate, you might want to look at Lagrange Interpolation.



    It sounds like you want a "close as possible fit", but you want to compare the accuracy of Polynomials of different degrees. You can use least squares techniques to find the coefficients of a polynomial of a given degree. To do this, you will use a matrix containing powers of your data points and a vector containing your coefficients.



    Say we have d data points, and we want a degree n polynomial. Then our matrix will have d rows and n+1 columns. The ith row contains the powers, 0 through n, of the ith data point. The vector contains the constant, then the linear coefficient, and so on.



    Multiplying the matrix and the vector gives you a vector of dimension d. (Independent of the degree of the polynomial used!) Typically we use these objects to minimize the error, but once you have the best coefficients for a given degree, you can multiply the matrix by the coefficient vector, and finally subtract the vector containing the y-values. The norm of this vector (X Powers)*(Coefs) - (Y data) is the square root of the sum of the squares of the error at each data point.



    If you find this norm for several different degrees, you can find the degree polynomial with the lowest error, and that should be the closest approximation for the degrees tested.



    Best of luck!






    share|cite|improve this answer









    $endgroup$

















      0












      $begingroup$

      Part of the issue is whether you want your function to fit the data "as closely as possible", or if you want it to hit every data point exactly.



      For example, if you want to fit some data that appears linear, using linear least squares approximation to find the two coefficients which minimize the error is the right way to go. However, if you want an exact estimate, you might want to look at Lagrange Interpolation.



      It sounds like you want a "close as possible fit", but you want to compare the accuracy of Polynomials of different degrees. You can use least squares techniques to find the coefficients of a polynomial of a given degree. To do this, you will use a matrix containing powers of your data points and a vector containing your coefficients.



      Say we have d data points, and we want a degree n polynomial. Then our matrix will have d rows and n+1 columns. The ith row contains the powers, 0 through n, of the ith data point. The vector contains the constant, then the linear coefficient, and so on.



      Multiplying the matrix and the vector gives you a vector of dimension d. (Independent of the degree of the polynomial used!) Typically we use these objects to minimize the error, but once you have the best coefficients for a given degree, you can multiply the matrix by the coefficient vector, and finally subtract the vector containing the y-values. The norm of this vector (X Powers)*(Coefs) - (Y data) is the square root of the sum of the squares of the error at each data point.



      If you find this norm for several different degrees, you can find the degree polynomial with the lowest error, and that should be the closest approximation for the degrees tested.



      Best of luck!






      share|cite|improve this answer









      $endgroup$















        0












        0








        0





        $begingroup$

        Part of the issue is whether you want your function to fit the data "as closely as possible", or if you want it to hit every data point exactly.



        For example, if you want to fit some data that appears linear, using linear least squares approximation to find the two coefficients which minimize the error is the right way to go. However, if you want an exact estimate, you might want to look at Lagrange Interpolation.



        It sounds like you want a "close as possible fit", but you want to compare the accuracy of Polynomials of different degrees. You can use least squares techniques to find the coefficients of a polynomial of a given degree. To do this, you will use a matrix containing powers of your data points and a vector containing your coefficients.



        Say we have d data points, and we want a degree n polynomial. Then our matrix will have d rows and n+1 columns. The ith row contains the powers, 0 through n, of the ith data point. The vector contains the constant, then the linear coefficient, and so on.



        Multiplying the matrix and the vector gives you a vector of dimension d. (Independent of the degree of the polynomial used!) Typically we use these objects to minimize the error, but once you have the best coefficients for a given degree, you can multiply the matrix by the coefficient vector, and finally subtract the vector containing the y-values. The norm of this vector (X Powers)*(Coefs) - (Y data) is the square root of the sum of the squares of the error at each data point.



        If you find this norm for several different degrees, you can find the degree polynomial with the lowest error, and that should be the closest approximation for the degrees tested.



        Best of luck!






        share|cite|improve this answer









        $endgroup$



        Part of the issue is whether you want your function to fit the data "as closely as possible", or if you want it to hit every data point exactly.



        For example, if you want to fit some data that appears linear, using linear least squares approximation to find the two coefficients which minimize the error is the right way to go. However, if you want an exact estimate, you might want to look at Lagrange Interpolation.



        It sounds like you want a "close as possible fit", but you want to compare the accuracy of Polynomials of different degrees. You can use least squares techniques to find the coefficients of a polynomial of a given degree. To do this, you will use a matrix containing powers of your data points and a vector containing your coefficients.



        Say we have d data points, and we want a degree n polynomial. Then our matrix will have d rows and n+1 columns. The ith row contains the powers, 0 through n, of the ith data point. The vector contains the constant, then the linear coefficient, and so on.



        Multiplying the matrix and the vector gives you a vector of dimension d. (Independent of the degree of the polynomial used!) Typically we use these objects to minimize the error, but once you have the best coefficients for a given degree, you can multiply the matrix by the coefficient vector, and finally subtract the vector containing the y-values. The norm of this vector (X Powers)*(Coefs) - (Y data) is the square root of the sum of the squares of the error at each data point.



        If you find this norm for several different degrees, you can find the degree polynomial with the lowest error, and that should be the closest approximation for the degrees tested.



        Best of luck!







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Oct 28 '15 at 20:51









        RonothRonoth

        935




        935



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Mathematics Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f1502316%2fwhen-fitting-a-polynomial-to-data-points-how-to-determine-the-reasonable-degree%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How should I support this large drywall patch? Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?How do I cover large gaps in drywall?How do I keep drywall around a patch from crumbling?Can I glue a second layer of drywall?How to patch long strip on drywall?Large drywall patch: how to avoid bulging seams?Drywall Mesh Patch vs. Bulge? To remove or not to remove?How to fix this drywall job?Prep drywall before backsplashWhat's the best way to fix this horrible drywall patch job?Drywall patching using 3M Patch Plus Primer

            random experiment with two different functions on unit interval Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)Random variable and probability space notionsRandom Walk with EdgesFinding functions where the increase over a random interval is Poisson distributedNumber of days until dayCan an observed event in fact be of zero probability?Unit random processmodels of coins and uniform distributionHow to get the number of successes given $n$ trials , probability $P$ and a random variable $X$Absorbing Markov chain in a computer. Is “almost every” turned into always convergence in computer executions?Stopped random walk is not uniformly integrable

            Lowndes Grove History Architecture References Navigation menu32°48′6″N 79°57′58″W / 32.80167°N 79.96611°W / 32.80167; -79.9661132°48′6″N 79°57′58″W / 32.80167°N 79.96611°W / 32.80167; -79.9661178002500"National Register Information System"Historic houses of South Carolina"Lowndes Grove""+32° 48' 6.00", −79° 57' 58.00""Lowndes Grove, Charleston County (260 St. Margaret St., Charleston)""Lowndes Grove"The Charleston ExpositionIt Happened in South Carolina"Lowndes Grove (House), Saint Margaret Street & Sixth Avenue, Charleston, Charleston County, SC(Photographs)"Plantations of the Carolina Low Countrye