search for: appoarch

Displaying 1 result from an estimated 1 matches for "appoarch".

Did you mean: appoach
2008 Aug 18
1
Fucntion scope question. General non-linear solution help.
...e to solve the equation is is the sum from k = i to N of choose(N,k) * MR ^ k * (1 - MR) ^ (N - k) - 0.50 = 0 I want to solve for MR. This seems like a non-linear equation to me. But I am having a hard time writing the function that implements the above. I could use 'for(...) as a brute force appoarch but I would like a more "elegant" solution. The variables 'N' and 'i' are basically constant so the function has to take these from some kind of global space. So if I take t brute force apporach I came up with: f <- function(MR) { k <- i:N return sum(choose(...