Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- JMP User Community
- :
- Discussions
- :
- Constrained least squares and exponential fitting

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Constrained least squares and exponential fitting

Apr 19, 2019 10:17 PM
(2347 views)

I am looking to fit Y ~ 1-exp{-[C1*(x/Xmax)^1+.......CN*(x/Xmax)^N]}. The order could be anywhere between 6 to 12 (max value of N). But before generating the fit, I need to estimate the coefficient using modified LSQ. I looked at the exponential fit (analyze fit Y-->X) and tried to enter a formulae but I do not want to directly fit the exponential curve, rather I want to estimate the best fit coefficients subect to some upper bound constraints due to the strictly monotically increasing nature of Y. . Essentially the closest I could find that represents my model is https://www.mathworks.com/help/optim/ug/lsqlin.html . Looks like a 2 step process with the LSQ s.t. linear constraints, followed by the actual exponential fit. Not sure if there is a 2 step or a straightshot approach for the fit for a given upper bound on the C1..CN.

Any pointers would be super helpful.

Thanks,

3 REPLIES 3

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Constrained least squares and exponential fitting

Created:
Apr 20, 2019 4:54 AM
| Last Modified: Apr 20, 2019 4:55 AM
(2335 views)
| Posted in reply to message from theseventhhill 04-20-2019

Can you linearize the relation with logs: -Log( 1 - Y ) = c1*(x/Xmax) + c2*(x/Xmax)^2 + ... + cN*(x/Xmax)^N ?

(This way might be invalid, depending on how the errors contribute to the original expression.)

Learn it once, use it forever!

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Constrained least squares and exponential fitting

I tried it but the estimated coefficients are off compared to some of the references I have from literature Maybe I am missing some bounds or constraints have not been entered properly. Will try again.

I also tried to add the custom model to the library as outlined here https://www.jmp.com/support/help/14-2/create-a-formula-using-the-model-library.shtml

but getting I/O error. I have admin rights not sure why this is happening. Is there any "edit" or "user input" mode that would allow me to add my nonlinear model to the library?

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Constrained least squares and exponential fitting

Created:
Apr 21, 2019 4:45 AM
| Last Modified: Apr 21, 2019 4:49 AM
(2309 views)
| Posted in reply to message from theseventhhill 04-20-2019

The estimates will be in the log space, not the original dimensions. Would that difference account for the unexpected results? Also, these results were not intended to be the best estimates but serve only as the initial values for the parameters before fitting the data with the Nonlinear platform. You must back-transform the starting values with Exp() function.

I don't know about I/O error. Is it possible that the script file is locked?

I suggest making your custom model manually / interactively first. That is, define the model first as a column formula. This way will demonstrate that such a model is feasible. The Model Library is only one way to fit a custom model. It is not required. This way will also provide the correct expression if you decide later to include it in the Model Library.

Learn it once, use it forever!

Article Labels

There are no labels assigned to this post.