cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
MathStatChem
Level VII

Parameter Constraints in Nonlinear Model Fitting

I am fitting a bi-exponential growth model of the following form:


bi-exponential model.png

 

I would like to constrain the parameter estimates so that dmax1< dmax2 and rate1<rate2.  

 

Is there any way to do this in the Nonlinear platform?  

13 REPLIES 13
hogi
Level XIII

Re: Parameter Constraints in Nonlinear Model Fitting

@Ben_BarrIngh , add-on question:
when I use "By" to fit multiple spectra, is there a trick to set global constraints and the lock?

hogi_0-1763553526988.png

 




something like:

new column ("by",Nominal, set each value(mod(row(),3)));
Nonlinear( Y( :input ), X( :fit ), by(:by),
SendToByGroup( Bygroup Default, 		
Parameter Bounds(
			h1( 0, 2 ),
			x1( 0, 100),
			h1( 0, 2 ),
			x2( 100, 200)
		) )
 )     

 

hogi
Level XIII

Re: Parameter Constraints in Nonlinear Model Fitting

workaround for the global constraints:

new column ("by",Nominal, set each value(mod(row(),3)));
nl = Nonlinear( Y( :input ), X( :fit ), by(:by) );

nl << Parameter Bounds(
			h1( 0, 2 ),
			x1( 0, 100 ),
			h2( 0, 2 ),
			x2( 100, 200 )
		)

The Lock doesn't seem to be recorded.
One could set constraints with min=max.

Re: Parameter Constraints in Nonlinear Model Fitting

I wonder if it would be easier to process the estimates after the nonlinear fitting without contstraints. I assume that the dmax1 and rate1 parameter estimates will go together and the dmax2 and rate2 parameter estimates will go together even if the dmax1 and rate1 parameter estimates are not always first. Then to achieve the order that you want, you can simply swap the order in the data table after saving the estimates table. This example shows what I have in mind:

 

Names Default to Here( 1 );

dt = New Table( "Double Exponential Models",
	Add Rows( 20 ),
	New Column( "dmax1",
		Values( J( 20, 1, Random Uniform() ) )
	),
	New Column( "rate1",
		Values( J( 20, 1, Random Uniform() ) )
	),
	New Column( "dmax2",
		Values( J( 20, 1, Random Uniform() ) )
	),
	New Column( "rate2",
		Values( J( 20, 1, Random Uniform() ) )
	)
);

Wait( 5 );

For Each Row(
	If( :rate1 > :rate2,
		temp = :dmax1;
		:dmax1 = :dmax2;
		:dmax2 = temp;
		temp = :rate1;
		:rate1 = :rate2;
		:rate2 = temp;
	);
);
MathStatChem
Level VII

Re: Parameter Constraints in Nonlinear Model Fitting

I had wrote some JSL that was nearly identical to that, and it did solve the problem.  Thanks for sharing.  

Recommended Articles