[R] machine dependency [polr()/optim()]

Boryeu Mao B.Mao at cerep.com
Tue Jun 4 22:24:22 CEST 2002


Dear R experts:

I am running some calculations using polr() in MASS library, and found some
differences in results obtained on two different machines (IRIX 6.5, and
Linux RH 7.1).  It is not clear to me whether this is due to some error in
my programming the calculation and how to resolve the differences, if
possible.

The polr() call is the following:

reg<-polr(dep~.,data=mm,start=c(1:(length(mm)-1+length(levels(dep))-1))/10.0
,Hess=TRUE)

where mm, with 827 rows, has one column of dependent variable ("dep"), and
29 columns of independent variables; there are 6 levels for "dep", 0-5.  For
a particular "mm", the following results (1st three coefficients) are
produced on both machines:

-0.07879468  0.05200974  0.57545475

But for a different "mm", the coefficients are:

-0.050742489 -0.006628615  0.537587536 [on IRIX]
-0.050634191 -0.007433505  0.541055510 [on Linux]

The only source for the difference (that I can find) is in "reg$niter":
256 (f.evals.function) and 100 (g.evals.function) [IRIX]
261 (f.evals.function) and 100 (g.evals.function) [Linux]

This somewhat dismissed my initial worry that some errors in my programs
caused the different values for the coefficients; but if the differences are
indeed due to machine differences, I am wondering if it is possible to
program the calculations (eg. to somehow force the number of iterations ?)
so that the results are reproduced for all cases.  Another observations is
that polr() produces identical results more exclusively if the number of
columns is smaller.

(A few more details: For the IRIX, the R binary was built with "-O2 -64" for
all compilers (f77 included), and on Linux, "-O2".)

Help and suggestions/hints for further narrowing the sources are
appreciated.  Thanks in Advance.

Boryeu Mao
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list