MHB Extrapolation and interpolation in line search optimization

AI Thread Summary
The equations discussed relate to cubic and quadratic interpolation used in line search optimization within MATLAB's fmincg function. The user seeks the origin of these specific equations, noting they are not found in standard numerical optimization literature, including a referenced book by Peter Glynn and Stephen M. Robinson. It is suggested that these equations may originate from Andrew Ng's Coursera Machine Learning course. The code implements a conditional check to determine whether to use a quadratic or cubic fit based on the function values. Ultimately, the recommendation is to focus on the code's functionality rather than its theoretical origins, while acknowledging the potential for errors in the implementation.
mathu2057
Messages
1
Reaction score
0
hi
can you tell me these equations:

A = 6*(f2-f3)/z3+3*(d2+d3); % cubic fit
B = 3*(f3-f2)-z3*(d3+2*d2);
z2 = (sqrt(B*B-A*d2*z3*z3)-B)/A; % numerical error
in MATLAB fmincg.m
https://github.com/emersonmoretto/mlclass-ex3/blob/master/fmincg.m
come from where??
it is either cubic interpolation or cubic interpolation...i look for
these equation in many website and books numerical optimization but
i do not find these equation even the book numerical optimization
for Peter Glynn Stephen M. Robinson p:57.(in the attachment copy of the page).it is not same in matlab
please help me from where these equation come from?
 

Attachments

  • eqq.jpg
    eqq.jpg
    53.7 KB · Views: 135
Mathematics news on Phys.org
From the MATLAB site I found some mention that they came from Coursera Machine Learning course taught by Andrew Ng.

https://www.mathworks.com/matlabcen...rization-used-to-classify-hand-written-digits

https://scicomp.stackexchange.com/questions/25876/understanding-matlabs-fmincg-optimization-function

In the code there is a test f2>f1 if true then a quadratic fit is done and if false then a cubit fit is done.

Matlab:
  if f2 > f1
    z2 = z3 - (0.5*d3*z3*z3)/(d3*z3+f2-f3);                 % quadratic fit
  else
    A = 6*(f2-f3)/z3+3*(d2+d3);                                 % cubic fit
    B = 3*(f3-f2)-z3*(d3+2*d2);
    z2 = (sqrt(B*B-A*d2*z3*z3)-B)/A;       % numerical error possible - ok!
  end

so I think you will just have to go with the code and not worry about where it comes from. The code should be sufficient for you to decide why they are needed. Of course, there is always the distinct possibility that the code is wrong but again you will have to test and decide if that's the case.
 
Suppose ,instead of the usual x,y coordinate system with an I basis vector along the x -axis and a corresponding j basis vector along the y-axis we instead have a different pair of basis vectors ,call them e and f along their respective axes. I have seen that this is an important subject in maths My question is what physical applications does such a model apply to? I am asking here because I have devoted quite a lot of time in the past to understanding convectors and the dual...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...

Similar threads

Back
Top