1/24/2021
Test 2
Test 2
ý Yuri Balasanov, Alexander Doynikov, iLykei 2017
Hello, Xianqian Yang
Upload result (.csv):
You have 5 more attempts
Browse…
No file selected
Interactive Result
projectID= 607 Assignment
Use your implementation of Newton-Raphson method to find root of the test function downloaded from the lecture documents panel.
Your project ID ( projectID ) is shown above. Read the test function:
Check the test function, second argument is your project ID:
Make sure that declaration of your optimizer function contains projectID argument.
where:
Description
dataPath = ‘C:/path_to_your_dir/’
testFunction<-readRDS(file=paste(dataPath,"MScA_Nonlinear_Models_Week2_TestFunction.rd
s",sep="/"))$Week2_Test_Function
testFunction(0,projectID)
my.Optimizer<-function(Start.Value,
testFunction,
Epsilon,
projectID)
https://ilykei.com/course/5655560d598e6616003f1986/assignments/5696a41b3e7daf1800b711f6/assignment 1/2
1/24/2021 Test 2
1. Start.Value is initial guess for the optimizer,
2. testFunction is the name of the test function that needs to be optimized, 3. Epsilon is stopping criterion (set Epsilon =0.0001),
4. projectID is individual project ID.
Find root ( my.Optimizer.root ) of the test function using your optimizer.
Find root ( uniroot.root ) using uniroot() . Use Epsilon =0.0001 as tolerance parameter ( tol = 0.0001) of
uniroot() . Set lower and upper points of the interval to be searched as uniroot.lower and uniroot.upper . Create list variable res
Save res to a file and upload the file using left sidebar.
Note:
Illustration of Newton-Raphson method on Interactive tab is not your individual test function.
res <- list(Start.Value = Start.Value,
my.Optimizer.root =my.root,
uniroot.root = uniroot$root,
uniroot.lower = uniroot.lower,
uniroot.upper = uniroot.upper)
write.table(res, file = paste(dataPath,'result.csv',sep = '/'), row.names = F)
https://ilykei.com/course/5655560d598e6616003f1986/assignments/5696a41b3e7daf1800b711f6/assignment 2/2