Nonlinear least squares example

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 พ.ย. 2024

ความคิดเห็น • 18

  • @natezimmer4489
    @natezimmer4489 8 ปีที่แล้ว +25

    Summary of video: "Plug equation into matlab" ... Video is just a tease since it doesn't show implementing a solver. It starts to sets up the thoeerry annnddd then mmk time to give up and plug into matlab. Would have been an awesome video if you demonstrated scratch approach to fit your data from start to finish.

  • @ajaygoyal436
    @ajaygoyal436 6 ปีที่แล้ว +2

    In this method, equations are assumed to be linear for simplifying calculations. That novel part is missing.But the concept that why method is iterative is very well explained.

  • @ParniaSh
    @ParniaSh 3 ปีที่แล้ว +2

    I appreciate your clear explanation!

  • @user-ue5dl1rg9d
    @user-ue5dl1rg9d 3 ปีที่แล้ว +1

    Nice explanation 👍

  • @Ferbegnini
    @Ferbegnini 7 ปีที่แล้ว +2

    Hello, thank you for this class.
    I have a doubt: I have a mass balance where I want to find the best k:
    - non-linear: C = C0 * exp(-k*t)
    - linear: ln (C0/C) = k*t
    And I want to use the function "fit" in MATLAB. I tried both ways (linear and non-linear, setting the method in the options) and it gave me different results for k.
    What would be the most correct result?
    Since linearizing is one extra step, does it input more error to the results?
    Thank you.

    • @Ferbegnini
      @Ferbegnini 7 ปีที่แล้ว

      Yes, thank you :)
      Could you point me a book that states what you said, so I could use it as a reference if needed?
      Another thing: whenever I try to use the function fit with LinearLeastSquares, MATLAB gives this warning:
      "Warning: The given fit options specify a LinearLeastSquares fit but the model specifies a
      NonlinearLeastSquares fit."
      I don't know what it means by "the model specifies". But I guess it still uses the linear method, since the results are different from the nonlinear.
      It displays this warning even if my data is completely linear, like:
      options = fitoptions('Method', 'LinearLeastSquares');
      xdata = [0; 300; 600; 900; 1200];
      ydata = [0; 3; 6; 9; 12];
      k = fit(xdata, ydata, 'k*x', options)

  • @pedrobolsi8366
    @pedrobolsi8366 2 ปีที่แล้ว +1

    Why is the 2 multiplying the summation of each partial derivative is dropped when going to matrix "F" (big F)

    • @drgregoryreeves
      @drgregoryreeves  2 ปีที่แล้ว

      Ya, great question. You could keep the "2" in there, but since we are ultimately solving for F = 0, the "2" can also be dropped.

  • @asmamessaadi4940
    @asmamessaadi4940 9 ปีที่แล้ว +1

    Thank you for the video,I want to ask you about apply Least square method to interpolate this function :
    y=Ab(e(-bx)-e(-cx))/(b-c),
    How can I linearize my function?

    • @asmamessaadi4940
      @asmamessaadi4940 9 ปีที่แล้ว

      Thank you for your answer, I'm working in nuclear medecine , I have lot of data to treat(about 18 million curves per package), I succeed until now to do non linear least square to get the coefficient of my function and plot my curve, but this method in machine takes lot of time, so I want to linearize my function to apply linear least square because is fast , the new function is [a.exp(bx)+c.exp(dx)]. example :
      f(x)=a.exp(b.x) ==> after linearization f(x)=ln(a)+b.x , so I get the forme b.x+a to apply Least square

  • @LibertarianLeninistRants
    @LibertarianLeninistRants 6 ปีที่แล้ว +2

    Should F(Y) not be equal to 2*sum(Y)?

  • @simoneaston1701
    @simoneaston1701 4 ปีที่แล้ว +1

    Thank you

    • @drgregoryreeves
      @drgregoryreeves  4 ปีที่แล้ว

      No problem! If you have a suggestion for a different video, feel free to post your idea here.

  • @elalsagala8460
    @elalsagala8460 6 ปีที่แล้ว +1

    thank you bro

  • @natezimmer4489
    @natezimmer4489 8 ปีที่แล้ว +2

    Summary of video: "Plug equation into matlab" ... Video is just a tease since it doesn't show implementing a solver. It starts to sets up the thoeerry annnddd then mmk time to give up and plug into matlab. Would have been an awesome video if you demonstrated scratch approach to fit your data from start to finish.

    • @natezimmer4489
      @natezimmer4489 8 ปีที่แล้ว

      *****
      Thanks for the reply, I know your probably a super busy guy, but sometime a video on a NL solver would be awesome.