Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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 efficientStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started