【发布时间】:2016-10-24 20:44:44
【问题描述】:
f <- function(x,q){ ## one step of the Newton iteration
x-(pnorm(x)-q)/dnorm(x)
}
x <- 0; #starting value
xj <- x # I don't know what is happening from this point onward!
for (i in 1:10){
x <- f(x,0.99);
xj <- c(xj,x)
}
print(xj)
基本上,我在这里尝试使用牛顿算法计算正态分布的 0.99 分位数,显然这就是解决方案。但是,我不遵循我在上面指出的步骤中发生的事情。有人可以简单地向我解释一下吗? for 循环中到底发生了什么?主要是,在 xj
谢谢!
【问题讨论】: