[R] Error code from optim - "NEW_X" what does it mean?

Adler, Avraham Avraham.Adler at guycarp.com
Mon Jun 3 19:40:15 CEST 2013


Hello, Jeff.

Thank you for your quick response. Unfortunately, a reproducible example will be difficult, if not impossible, as it depends on a particular compilation of both 'R' and 'Rblas.dll' as described in <https://stat.ethz.ch/pipermail/r-devel/2013-May/066731.html>. I therefore was hoping that someone would recognize the error code having seen it before, know what it means or what could cause it, and could help direct me towards a solution.


If you, or someone, has a Nehelem (corei7) or SandyBridge (corei7-avx) processor running Windows 64-bit, I can describe (off-line) step-by-step as to how to generate the necessary files, or I'd be happy to e-mail the flawed Rblas.dll if you or anyone has access to the above kinds of machines and OS, and are interested.


To address the request for a little more information, inside `factanal`, there is a call to optim. Using the reference BLAS, `fa <- factanal( ~., 2, data = swiss)` works fine. Using a specific compiled BLAS it returns "unable to optimize". Breaking it down further (by running the procedures in factanal.R manually) the error comes from an optim call in `factanal.mle.fit` that does not converge, but returns an ever-so-slightly different set of numbers and the "NEW_X" error code. Running the code with the reference BLAS will return the PASS version below, running the code with the flawed BLAS returns the FAIL version. The code is just running the subprocedures in `factanal.R` using "data=swiss" and factors=2:


PASS
		> nfit

		Call:
		NULL

		Uniquenesses:
			   Fertility      Agriculture      Examination        Education
				   0.420            0.492            0.270            0.005
				Catholic Infant.Mortality
				   0.061            0.960

		Loadings:
						 Factor1 Factor2
		Fertility        -0.674   0.356
		Agriculture      -0.648   0.297
		Examination       0.713  -0.471
		Education         0.997
		Catholic         -0.178   0.953
		Infant.Mortality -0.104   0.169

					   Factor1 Factor2
		SS loadings      2.419   1.373
		Proportion Var   0.403   0.229
		Cumulative Var   0.403   0.632

		The degrees of freedom for the model is 4 and the fit was 0.5017
		> nfit$converged
		[1] TRUE

FAIL

		> nfit

		Call:
		NULL

		Uniquenesses:
			   Fertility      Agriculture      Examination        Education
				   0.417            0.487            0.258            0.012
				Catholic Infant.Mortality
				   0.097            0.951

		Loadings:
						 Factor1 Factor2
		Fertility        -0.683   0.340
		Agriculture      -0.658   0.282
		Examination       0.728  -0.461
		Education         0.993
		Catholic         -0.203   0.929
		Infant.Mortality -0.110   0.171

					   Factor1 Factor2
		SS loadings      2.469   1.302
		Proportion Var   0.411   0.217
		Cumulative Var   0.411   0.628

		The degrees of freedom for the model is 4 and the fit was 0.5042
		> nfit$converged
		[1] FALSE



Thank you,

Avraham Adler


-----Original Message-----
From: Jeff Newmiller
Sent: Monday, June 03, 2013 1:03 PM
To: Adler, Avraham; r-help at r-project.org
Subject: Re: [R] Error code from optim - "NEW_X" what does it mean?

Your email Is missing a reproducible example... very sub-optimal, likely to be ignored.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.

"Adler, Avraham" <Avraham.Adler at guycarp.com> wrote:

>Hello.
>
>Does anyone know what the error code "NEW_X" means in optim? Here is 
>what the return looks like:
>
>		$counts
>		function gradient
>			 302      302
>
>		$convergence
>		[1] 1
>
>		$message
>		[1] "NEW_X"
>
>I have searched and found a couple of mentions without responses:
>
><https://stat.ethz.ch/pipermail/r-help/2011-September/290722.html>
>September 2011
><https://stat.ethz.ch/pipermail/r-devel/2013-May/066731.html>       
>Full disclosure, this is my (unanswered) question on R-devel
>
>
>I can only find one instance of the call in `optim.c` and I don't
>understand what it is doing.
>
>Thank you,
>
>Avraham Adler
>
>______________________________________________
>R-help at r-project.org 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.



More information about the R-help mailing list