Yahoo Clever wird am 4. Mai 2021 (Eastern Time, Zeitzone US-Ostküste) eingestellt. Ab dem 20. April 2021 (Eastern Time) ist die Website von Yahoo Clever nur noch im reinen Lesemodus verfügbar. Andere Yahoo Produkte oder Dienste oder Ihr Yahoo Account sind von diesen Änderungen nicht betroffen. Auf dieser Hilfeseite finden Sie weitere Informationen zur Einstellung von Yahoo Clever und dazu, wie Sie Ihre Daten herunterladen.
How to find initial guess for Newton's Method?
I know how to use Newton's method but what how do I find the most reasonable/best initial guess to start off with?
ex. find positive root of equation
f(x) = x^2 -2=0 initial root not given
4 Antworten
- vor 9 JahrenBeste Antwort
Much depends on what you are doing, on the specific problem. If you have a choice, a good method is often a graphical method. Plot the function. Look for where it crosses the x axis. I'd bet that gives you a good starting value.
On other problems you won't be given such an option. Finding an automatic good choice of starting value is a terribly difficult thing for a completely general function. On one variable problems, a good solution is to sample the function at a sequence of points. Look for a pair of points that bracket a root. That is, find x_1 and x_2 such that f(x_1) and f(x_2) have different signs. This will often provide a starting point, although it does not ensure that fact. For example, find a root of f(x) = 1/x. But while f(-1) and f(1) have opposite signs, there is no root that lies in the interval [-1,1].
Newton's method will converge on the particular problem you have posed for almost any guess (except zero.) So there may be little reason to find a good stating point, as it will converge rapidly almost no matter what. On other problems, the iterative scheme will diverge for bad starting values. So an important thing to understand is the basin of convergence. This is the set of points that will converge to a given solution, given that they are used as starting values for a given solver. What is the basin of convergence for Newton's method on this problem? There are two roots (solutions) to this problem. See that Newton will converge to sqrt(2) for any finite value in the interval (0,inf), and converge to -sqrt(2) for any finite starting point in the interval (-inf,0).
Ok, so the above may not really help us much, since the objective is to choose an intelligent guess. Sometimes you may be able to find an approximation for your function, one that is easily inverted. This may be based on a low order (truncated) series for your function.
Finally, lets look more carefully at the specific problem posed. Find a good starting point to solve for a root of:
f(x) = x^2 - 2 =0.
Note that for small x (any starting point that is less than sqrt(2)), the first iteration will drive out a long way, and then be forced to move inwards.
Writing out the iterative scheme for Newton's method, we see it looks like
x(n+1) = x(n) - f(x(n))/f'(x(n) = x(n) - (x(n)^2 - 2)/(2*x(n))
I'll do this in MATLAB. Starting at x = 0.1, we see the iteration immediately jump far out, then
>> x = 0.1;
>> x = x - (x^2 - 2)/(2*x)
x =
10.05
>> x = x - (x^2 - 2)/(2*x)
x =
5.12450248756219
>> x = x - (x^2 - 2)/(2*x)
x =
2.75739213841957
>> x = x - (x^2 - 2)/(2*x)
x =
1.74135758044959
>> x = x - (x^2 - 2)/(2*x)
x =
1.44494338195892
>> x = x - (x^2 - 2)/(2*x)
x =
1.41454033012869
>> x = x - (x^2 - 2)/(2*x)
x =
1.4142136001158
>> x = x - (x^2 - 2)/(2*x)
x =
1.4142135623731
>> x = x - (x^2 - 2)/(2*x)
x =
1.4142135623731
Newton's method here is quadratically convergent. In fact, it has converged here to sqrt(2) as we should expect. All of the digits displayed are in agreement with the known solution.
>> sqrt(2)
ans =
1.4142135623731
In fact, see that for any starting point greater than the root here, Newton's method will converge quickly. So while the first point was a terrible choice, it moved immediately into a realm where the iteration became one that is monotonically convergent.
Finally, you need to understand that on some problems, Newton's method is not so quickly convergent. For example, find a root for the function f(x) = x^4 using Newton iterations. Newton's method iterations will reduce to
x(n+1) = 3/4*x(n)
While these iterations will converge to x = 0, it is not a rapid convergence.
The point of this long discussion is to recognize that every problem is different, and that you will gain greatly by understanding your problem, as well as the numerical method employed for its solution.
- CherylLv 4vor 5 Jahren
Newton's method for what? Finding zeros? As humans, the best way is probably a combination of graphical and theoretical analysis. You just have to make some inferences about each function to decide how many roots there are and where they should be, roughly. If you're writing a computer program, you need something automatic, so you'd have to come up with some sort of search algorithm. With x^2 - 7, it doesn't matter where you start. It will converge from anywhere. This is not true in general so you do have to try to get "close". For square-root finding, I've done things like start with n/2 (you want the square root of 7, so start with 3.5). For x^3 - cos x, I'd go through the following theoretical analysis: the cosine term is always between -1 and +1. So for all x large enough (>1 actually), I know f(x) will be >0, and for all x < -1, f(x) will be < 0. So any roots have to lie in [-1, 1]. But if you plot the function, you'll see exactly how many roots there are and where they should be (roughly).
- Anonymvor 9 Jahren
Hi :
It one of of my most favorite time waster way of sloving a problem but it does work
the way I do this is find the the closest number to it with out going over
Make a guess number that is the closest number to it with out going over
Step 1 :
solve the equation and see if your too high
if you are not
than add one unit to the guess number
Repeat Step1
- than take it down one unit
add 5/(10^next decimal place number)
Is it to how many decimal places to where you want to go to?
if yes - Stop
Repeat Step 1
Your problem for example
closest root to 2 with going over 1 so
1^2 - 2 = 0
1 -2 = 0
-1 = 0 - too low
try 2
2^2- 2 = 0
4 - 2 = 0 too high
back to 1
add .5
Now try 1 .5
1.5^2 - 2 = 0
2.25 - 2 = 0
.25 = 0 - too high but closer to it
so your answer must be somewhere between 1 and 1.5
try 1.2
1.2^2 - 2 = 0
1.44 - 2 = 0
-1.56 = 0 - too low
try
1.4
1.4^2
1.96 - 2 = ..04 too high but really close
so the answer must be between 1.4 and 1.5
add .05 to 1.4
1.45^-2 = 0
2.1025- 2 = 0.1025 - too high
try 1.42^2 - 2 = 0
2.0164- 2 = .0164 still too high but closer to it
try 1.41
1.9881 - 2 = -0.0119 way too low but since 1.42 is too high
the answer must be 1.41 accurate to 2 decimal place
and .005 to
and keep doing it
and if you keep doing it
you will get 1.4142135623730950488016887242097 and -1.4142135623730950488016887242097 for your answer
- Anonymvor 9 Jahren
Really, you just avoid the minimum, and close to where you think the answer is.
Don't use 0, and try around 1.4-1.5