[R] Solving Systems of Non-linear equations

Peter Dalgaard p.dalgaard at biostat.ku.dk
Wed Nov 30 17:02:12 CET 2005


Scott Story <sstory at montana.edu> writes:

> I am trying to write a function that will solve a simple system of 
> nonlinear equations for the parameters that describe the beta 
> distribution (a,b) given the mean and variance.
> 
> 
> mean = a/(a+b)
> variance = (a*b)/(((a+b)^2) * (a+b+1))
> 
> Any help as to where to start would be welcome.

On a pad of paper...

First look at mean*(1-mean)/variance, and the rest should follow. (Hint
minimized in case this was homework...)

-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907




More information about the R-help mailing list