cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
Choose Language Hide Translation Bar
MathStatChem
Level VI

Nonlinear platform custom loss function - shrinkage estimation

I would like to try to do nonlinear model fitting with the Nonlinear platform, using a custom loss function to do shrinkage parameter estimation, something that would be similar to the LASSO loss function for regression.  

 

For example, if I have this non-linear model (Named "NLFunction" with a, g, c, and Tz as the parameters in the model)

MathStatChem_0-1740425726176.png

 

I would like to use a loss function like this

MathStatChem_2-1740425939405.png

which is "sort of" like the Lasso loss function.  The idea is to "shrink" the parameter estimates a little, in order to find a better model fit and make the model fitting less ill-conditioned.  

 

think I can do this manually by specifying the loss function in the launch dialog, but unsure if it is actually using the loss function the way I intend it to.

MathStatChem_3-1740426267410.png

If I run this, it does run and give results, but saving the script from the analysis does not give back the manual loss function I specified.  

 

Anyone have any input if this could work and would allow for shrinkage estimation in a Nonlinear model fit?  

 

 

 

3 REPLIES 3
Victor_G
Super User

Re: Nonlinear platform custom loss function - shrinkage estimation

Hi @MathStatChem,

 

I guess you already have read the documentation about Statistical Details for Custom Loss Functions ?

Looking at Example of a Poisson Loss Function, it seems the custom loss function should be used in the "Loss" parameter when launching your model :

Victor_G_0-1740559189752.png

You can see if the custom loss function is used directly when the analysis window opens :

Victor_G_1-1740559272818.png

 

I won't be able to dive deeper into the topic, as there may be not enough informations/results/data to reproduce the analysis and help you. Have you tried running a nonlinear modeling without the custom loss function ? How similar/different were the results ?

 

I have no opinion on the custom loss function you have created, I just find strange to use a "linear penalization" of the coefficients in the case of nonlinear modeling : you try to reduce the size of the coefficients the same way, no matter the relative magnitude of these coefficients, which may greatly differ if these coefficients are part of an exponential function or a linear function. Maybe taking in consideration the use of these coefficient and using a nonlinear penalization (with |a|, exp/ln(g), ...) could help ?

 

Hope these few ideas may help you,

Victor GUILLER

"It is not unusual for a well-designed experiment to analyze itself" (Box, Hunter and Hunter)
MathStatChem
Level VI

Re: Nonlinear platform custom loss function - shrinkage estimation

I've read the documentation, and I've used the platform extensively, just not as familiar with using custom loss functions.  Based on what I have tried and experimented with, I think the answer to my question is "no", you cannot do this.  I think it is because the custom loss function can be a function of the parameters that are already in the model, but I'm not sure on that.  

 

The motivation for doing this is that often for nonlinear models, the parameters estimates tend to be highly correlated and the objective (loss) function can be very flat in the region where the optimum loss is found, making it hard for the algorithm to converge.  I think what I would actually like to do is something more akin to ridge regression, where the penalty added to the SSE is a multiple of the sum of the squared parameter estimates.  

MathStatChem
Level VI

Re: Nonlinear platform custom loss function - shrinkage estimation

I contacted JMP Technical Support, and they shared a way to do this.  I had not realized that when you use Nonlinear, you can fit a nonlinear model solely by providing a loss function in the bottom section, without putting any columns into roles.  You lose some functionality this way (e.g. cannot make plots, cannot use profiler) in the platform, but you can do the parameter estimation.  So using the custom loss function (shown above) works.