Question: I have to write an R code that does the following: I am a little lost on how to and where to start. so far

I have to write an R code that does the following:

I have to write an R code that does the following: I

I am a little lost on how to and where to start. so far i have done this:

xs

# defining the function that we want to optimize f

plot(xs, f(xs), type = "l", xlab = "x", ylab = expression((x**2 - 5)*sin(x)))

grad

Any help/advice will be appreciated!

Use gradient Descent to find local minimum of the function: f(x) (25)sin() To solve question, you need to use following parameters and requirements set Q 0.001 as step size use two different stop criteria to control the loop define the value by yourself Try at least 10 different starting points between [0, 100]. In the end, you should obtain 20 local minimum values from two methods. Finally, you need to compare the result from two different criteria, which one is more efficient

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!