optimx error (was Re: BioGeoBEARS)

350 views
Skip to first unread message

Nick Matzke

unread,
Nov 7, 2013, 10:50:33 PM11/7/13
to bioge...@googlegroups.com
Hi all,

Answer to another question below. Basically, if you get an
error with optimx like this:

===================
*Error in
params_into_BioGeoBEARS_model_object(BioGeoBEARS_model_object,
: *
* replacement has length zero*
*In addition: Warning messages:*
*1: In optimx.setup(par, fn, gr, hess, lower, upper, method,
itnmax, :*
* optimx: No match to available methods*
*2: In optimx.setup(par, fn, gr, hess, lower, upper, method,
itnmax, :*
* Default method when bounds specified is L-BFGS-B to match
optim()*
*3: In optim(par = par, fn = ufn, gr = ugr, lower = lower,
upper = upper, :*
* method L-BFGS-B uses 'factr' (and 'pgtol') instead of
'reltol' and 'abstol'*

===================

...it is because you've got the default version of optimx
(2013), whereas BioGeoBEARS currently needs the 2012
version. The optimx authors changed something when they
updated the optimx package.

Instructions for switching to 2012 optimx are here:

http://phylo.wikidot.com/biogeobears#toc3

You can type:

================
sessionInfo()
================

...to check your version.

An additional option is to set use_optimx to FALSE. This
causes the R native optim() function to be used. I like
optimx a little better as it is more customizable and I
could therefore make it a little faster, but optim() will
produce the same results.

I will fix this at some point soon, but for now that's the
workaround.

Cheers!
Nick


On 11/7/13 1:27 PM, Juan wrote:
> YEAAAAH!! That was it!! Thank you very much for your help!!
> Lovely figures!! ;)
>
> All the best,
>
> Juan
>
>
> El 07/11/2013, a las 18:29, Nick Matzke escribi�:
>
>> Hi! Apologies, this error is due to the optimx authors
>> updating to 2013 optimx BioGeoBEARS currently requires
>> 2012 optimx, instructions for switching to 2012 optimx are
>> here:
>>
>> Update August 24, 2013: issue with "optimx" dependency
>> http://phylo.wikidot.com/biogeobears#toc3
>>
>> Cheers!
>> Nick
>>
>>
>> On 11/7/13 11:56 AM, Juan L�pez Cantalapiedra wrote:
>>> Dear Nick
>>>
>>> After a few weeks I have returned to the BioGeoBEARS
>>> adventure. I kept playing around with the constrains, and
>>> even with no constrains at all I keep getting errors. Could
>>> be that my tree is wrong? I looked at it and seems fine.
>>> Even with no constrains at all it is impossible. The run
>>> just using the tree file and the geographic data crashes
>>> too. In all the cases this is the error:
>>>
>>> *Error in
>>> params_into_BioGeoBEARS_model_object(BioGeoBEARS_model_object,
>>> : *
>>> * replacement has length zero*
>>> *In addition: Warning messages:*
>>> *1: In optimx.setup(par, fn, gr, hess, lower, upper, method,
>>> itnmax, :*
>>> * optimx: No match to available methods*
>>> *2: In optimx.setup(par, fn, gr, hess, lower, upper, method,
>>> itnmax, :*
>>> * Default method when bounds specified is L-BFGS-B to match
>>> optim()*
>>> *3: In optim(par = par, fn = ufn, gr = ugr, lower = lower,
>>> upper = upper, :*
>>> * method L-BFGS-B uses 'factr' (and 'pgtol') instead of
>>> 'reltol' and 'abstol'*
>>>
>>> Any thoughts? AARRRg What could it be!?! I attach my test
>>> files.
>>>
>>> Thank you so much for your time!!
>>>
>>> Juan
>>>
>>> --
>>> Juan L�pez Cantalapiedra
>>> jlope...@gmail.com <mailto:jlope...@gmail.com>
>>> Visit my profile in Academia
>>> <http://biochange-lab.academia.edu/JuanLCantalapiedra/About>
>>> &
>>> ResearchGate
>>> <https://www.researchgate.net/profile/Juan_Cantalapiedra>
>>> Dpto. Paleobiolog�a
>>> Museo Nacional de Ciencias Naturales
>>> C/Pinar, 25
>>> 28006, Madrid, Espa�a
>>
>> --
>> ====================================================
>> Nicholas J. Matzke, Ph.D.
>> NIMBioS Postdoctoral Fellow in Mathematical Biology
>> National Institute for Mathematical and Biological
>> Synthesis (NIMBioS, www.nimbios.org)
>> Cell: 510-301-0179
>> Email: mat...@nimbios.org
>> Links to CV, R packages, etc.:
>> http://phylo.wikidot.com/nicholas-j-matzke
>>
>> Also: Brian O'Meara Lab
>> Postdoc office: 425a Hesler
>> Department of Ecology and Evolutionary Biology
>> University of Tennessee, Knoxville
>> http://www.brianomeara.info/
>>
>> NIMBioS Office:
>> Claxton Bldg. #110B
>> Office phone: 865-974-4873
>>
>> NIMBioS:
>> 1122 Volunteer Blvd., Suite 106
>> University of Tennessee
>> Knoxville, TN 37996-3410
>> Phone: (865) 974-9334
>> Fax: (865) 974-9300
>>
>> -----------------------------------------------------
>> "[W]hen people thought the earth was flat, they were
>> wrong. When people thought the earth was spherical, they
>> were wrong. But if you think that thinking the earth is
>> spherical is just as wrong as thinking the earth is flat,
>> then your view is wronger than both of them put together."
>>
>> Isaac Asimov (1989). "The Relativity of Wrong." The
>> Skeptical Inquirer, 14(1), 35-44. Fall 1989.
>> http://chem.tufts.edu/AnswersInScience/RelativityofWrong.htm
>> ====================================================
>
> --
> Juan L�pez Cantalapiedra
> jlope...@gmail.com <mailto:jlope...@gmail.com>
> Visit my profile in Academia.edu
> <http://biochange-lab.academia.edu/JuanLCantalapiedra/About>
> Dpto. Paleobiolog�a
> Museo Nacional de Ciencias Naturales
> C/Pinar, 25
> 28006, Madrid, Espa�a
>

--
====================================================
Nicholas J. Matzke, Ph.D.
NIMBioS Postdoctoral Fellow in Mathematical Biology
National Institute for Mathematical and Biological Synthesis
(NIMBioS, www.nimbios.org)
Cell: 510-301-0179
Email: mat...@nimbios.org
Links to CV, R packages, etc.:
http://phylo.wikidot.com/nicholas-j-matzke

Also: Brian O'Meara Lab
Postdoc office: 425a Hesler
Department of Ecology and Evolutionary Biology
University of Tennessee, Knoxville
http://www.brianomeara.info/

NIMBioS Office:
Claxton Bldg. #110B
Office phone: 865-974-4873

NIMBioS:
1122 Volunteer Blvd., Suite 106
University of Tennessee
Knoxville, TN 37996-3410
Phone: (865) 974-9334
Fax: (865) 974-9300

-----------------------------------------------------
"[W]hen people thought the earth was flat, they were wrong.
When people thought the earth was spherical, they were
wrong. But if you think that thinking the earth is spherical
is just as wrong as thinking the earth is flat, then your
view is wronger than both of them put together."

Isaac Asimov (1989). "The Relativity of Wrong." The
Skeptical Inquirer, 14(1), 35-44. Fall 1989.
http://chem.tufts.edu/AnswersInScience/RelativityofWrong.htm
====================================================
Reply all
Reply to author
Forward
0 new messages