Answered step by step
Verified Expert Solution
Link Copied!

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:

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

More Books

Students also viewed these Databases questions

Question

Why is job analysis considered to be a basic HR tool?

Answered: 1 week ago