Hi R-users,I'm trying to solve a non linear equation, to find the degrees of freedom of a mixture of t student. I'm sure i wrote the minimization equation in the right way, but when i try to run the EM algorithm to estimate the parameters of the mixture, the following error will appear: Error in uniroot(function(z) log(z/2) - digamma(z/2) + 1 - log((z + d)/2) + : f() values at end points not of opposite sign I don't know how solve this problem, i have already tried using the function optimize, but it doesn't work. Someone could help me? thanks a lot -- Dr. Daniele Riggi, PhD student University of Milano-Bicocca Department of Statistics Building U7, Via Bicocca degli Arcimboldi, 8 20126 Milano, Italy cell. +39 328 3380690 mailto: daniele.riggi@gmail.com [[alternative HTML version deleted]]
Hi R-users,I'm trying to solve a non linear equation, to find the degrees of freedom of a mixture of t student. I'm sure i wrote the minimization equation in the right way, but when i try to run the EM algorithm to estimate the parameters of the mixture, the following error will appear: Error in uniroot(function(z) log(z/2) - digamma(z/2) + 1 - log((z + d)/2) + : f() values at end points not of opposite sign I don't know how solve this problem, i have already tried using the function optimize, but it doesn't work. Someone could help me? thanks a lot -- Dr. Daniele Riggi, PhD student University of Milano-Bicocca Department of Statistics Building U7, Via Bicocca degli Arcimboldi, 8 20126 Milano, Italy cell. +39 328 3380690 mailto: daniele.riggi@gmail.com [[alternative HTML version deleted]]
daniele riggi wrote:> > Hi R-users,I'm trying to solve a non linear equation, to find the degrees > of > freedom of a mixture of t student. I'm sure i wrote the minimization > equation in the right way, but when i try to run the EM algorithm to > estimate the parameters of the mixture, the following error will appear: > > Error in uniroot(function(z) log(z/2) - digamma(z/2) + 1 - log((z + d)/2) > + > : > f() values at end points not of opposite sign > > I don't know how solve this problem, i have already tried using the > function > optimize, but it doesn't work. > >Well, this isn't exactly a reproducible example ... As the error message suggests, the uniroot() function is finding that the endpoints you have given it are of the same signs, hence it doesn't know how to set about looking for a root. I would suggest that you insert a debugging statement that prints the values of the endpoints and the values of the function evaluated at those endpoints (see ?cat) -- perhaps that will give you a clue. Ben Bolker -- View this message in context: http://www.nabble.com/problem-with-uniroot-tp23853892p23859678.html Sent from the R help mailing list archive at Nabble.com.