Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Curve fitting

  • 16-12-2011 6:21pm
    #1
    Registered Users, Registered Users 2 Posts: 8


    I was wondering, what is a good (cheap) piece of software that is useful for curve fitting? When I look it up, Matlab seems to come up quite a lot. Prism (V.5) is the only programme I currently have access to that performs this function as far as I know. I see there's also an addon you can get for Excel (XLift).

    Incidentally, I would also like to know what the most accurate method for fitting a curve by hand would be. Just for example's sake, I'll make up some x,y co-ordinates.

    (20,100)
    (40,250)
    (60, 580)
    (80, 1000)
    (100, 2000)

    Can you work out an an accurate formula for the curve based on this data?


Comments

  • Registered Users, Registered Users 2 Posts: 534 ✭✭✭PaulieBoy


    Biruni wrote: »
    I was wondering, what is a good (cheap) piece of software that is useful for curve fitting? When I look it up, Matlab seems to come up quite a lot. Prism (V.5) is the only programme I currently have access to that performs this function as far as I know. I see there's also an addon you can get for Excel (XLift).

    Incidentally, I would also like to know what the most accurate method for fitting a curve by hand would be. Just for example's sake, I'll make up some x,y co-ordinates.

    (20,100)
    (40,250)
    (60, 580)
    (80, 1000)
    (100, 2000)

    Can you work out an an accurate formula for the curve based on this data?
    I would think cubic splines would help ya there, at least I think they would!


  • Registered Users, Registered Users 2 Posts: 13,077 ✭✭✭✭bnt


    I find Excel handy for quick curve fitting: plot the data, right-click on the plot line, and say "Add Trend". You can choose from different curve type, and you have options to display the formula and a R² goodness of fit. The closer R² is to 1, the better the fit.

    Alternatively, you could get Octave, which is a MATLAB clone, here. I just tried the following, using the "polyfit" function:
    x = 20:20:100
    y = [100, 250, 580, 1000, 2000]
    
    order = 1  
    # 1st order curve (linear)
    
    P = polyfit(x, y, order);
    #P is an array with the polynomial factors
    
    # calculate fitted curve for each X point
    f = P(1)*x + P(2)
    
    # plot the data - sample data vs fitted data
    plot(x, y)
    hold on 
    plot(x, f)
    hold off
    

    You are the type of what the age is searching for, and what it is afraid it has found. I am so glad that you have never done anything, never carved a statue, or painted a picture, or produced anything outside of yourself! Life has been your art. You have set yourself to music. Your days are your sonnets.

    ―Oscar Wilde predicting Social Media, in The Picture of Dorian Gray



Advertisement