Forum: help
Monitor Forum | Start New Threadneed help to solve an equation in R [ Reply ] By: Neetu Shah on 2017-05-26 02:16 | [forum:45161] |
I am trying to make a function to solve an equation that is given below: findH <- function(p_star, k){ fun <- function(y){ (pnorm(y+h))^(k-1)*dnorm(y) } lhs <- integrate(fun, -Inf, Inf)$value return(uniroot(lhs, lower = -10, upper = 10, tol = p_star)$root) } In lhs, I integrated a function with respect to y and there would be a unknown h that I need to find. I need to equate this lhs to p_star value in order to find h. Which function should I use to solve this equation? |