Displaying 1 result from an estimated 1 matches for "firstfirstderivative".
2007 Oct 27
1
Newton method iteration problem
...pha
}
#generate the first derivative of the of the target function
firstDerivative<-function(x){
exp(-(x^2)/2)/sqrt(2*pi)
}
# Finding the root by Newton method
rootFinding<-function(initialX,setAlpha){
while(target(initialX,setAlpha)!=0){
initialX<-initialX-(target(initialX,setAlpha)/firstfirstDerivative(initialX)
}
initialX
}
--
View this message in context: http://www.nabble.com/Newton-method-iteration-problem-tf4701085.html#a13439031
Sent from the R help mailing list archive at Nabble.com.