Skip to content

Model vs CompositeModel class #863

Closed Answered by newville
David-HERS asked this question in Q&A
Discussion options

You must be logged in to vote

Using a CompositeModel instead of hand-coded Model is really a matter of convenience. Asteval is used only if you use an ExpressionModel (which should be viewed as a "cute trick", and maybe useable, but not really recommended) and for implementing constraints.

The resulting route through Python code will be different for a Model function that implements the same functionality as a CompositeModel, but the mathematics of the solution (basically down to the number of function evaluations and steps in the parameter values) should be identical.

Just to be clear, the entire rationale for lmfit existing at all, and the entire rationale for scipy existing at all can be described as "convenience".…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by David-HERS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants