I can't for the life of me figure out how to get the roots for this simple
(but sovable only iteratively) equation in R:
x = z*(1-(1-2/z)^y
where x and y are known, and z is unknown. In Matlab, this amounts to:
[my.solution] = solve('x = z*(1-(1-2/z)^y')
my.solution.real = solution(y-1,y)
% bottom line displays non-imaginary solution (last element)
Obviously, I'm deeply unqualified as a mathematician or programmer and
regret wasting your time if this question is really basic. I would very
much appreciate even the smallest morsel of time that you might spend on
this, and yes, you could be my hero.
Many Thanks,
Boris
P.S. The above equation is from: Paxman GJ (1963). Maximum likelihood
estimation of the number of self-sterility alleles in a population.
Genetics 48: 1029-1032.
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.