Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have a program that calls FindDistributionParameters and I get the Mathematica message FindMaximum::eit each time I call the function.

The message is FindMaximum::eit: The algorithm does not converge to the tolerance of _4.641588833612792`*^-9_ in 517 iterations. The best estimated solution, with feasibility residual, KKT residual, or complementary residual of {8.785431001660695650243387×10-19,7.654089593359381289428268×10-7,3.755486893336661804848494×10-19}, is returned. 

I want to save the numbers in the messages, so I setup a list to hold the messages as follows: AppendTo[messagelist, {General::eit}];

This saves the following, with none of the numbers in the original message: The algorithm does not converge to the tolerance of 1 in 2 iterations. The best estimated solution, with feasibility residual, KKT residual, or complementary residual of 3, is returned.

How can I access the numbers in the message and save them to a list or something else?

Secondarily, is there a way to increase the number of iterations in FindDistributionParameters?

share|improve this question

1 Answer 1

General::eit is simply the format string for the message itself. There is MessageList[n] which gives the names of all messages output during the evaluation of input line n but that doesn't get you any further.

Defining a value for $MessagePrePrint would be the way to do this, see the second Scope example using Block, Reap and Sow in the documentation, but rather easier is to simply copy and paste the numbers from the displayed message.

And to answer the second part of your question... to increase the iteration limit use something like:

FindDistributionParameters[{1.5, 2.8, 4.3, .5}, LaplaceDistribution[μ, σ], 
 ParameterEstimator -> {"MaximumLikelihood", Method -> "FindMaximum", MaxIterations -> 1000}]
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.