- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Model tuning - Optimization per line
Dear all,
I am trying to introduce a problem. Imagine a table with 100 lines and 6 columns (PAR1, PAR2, VAR, MOD, MEA, ERR).
The MOD column contains a model (= a formula) that depends on 3 parameters P1, P2 and VAR.
The values of the columns P1 and P2 are fixed and different for each lines.
The VAR column contains the third parameters, which is initialized at a default value at the beginning (let's say 1). To give a concrete example, let's imagine that MOD contains the following formula: MOD [i] = 3.P1 [i] ^ 3 + COS (2.P2 [i] ^ 2 + VAR [i]).
The MEA column contains the results of a measurement, different for each line.
And finaly, ERR contains the quadratic error between the model and the measurement, that is to say: ERR [i] = (MOD [i] - MEA [i]) ^ 2.
My target is to determine, for each line, the value of VAR [i] so that the value of the model is equal to the one of the measurement.
In Excel, I would use the Solver to do that. We can also imagine a JSL script in which, for each line, an algorithm (simple dichotomy, Newton, Brent, ...) will find the root of the function F [i] = MOD [i] - MEA [i] by minimizing the quantity ERR [i].
But, I am wondering if there is a simpler alternative to do that? With a JMP platform?
Waiting for your kind answer.
Stéphane
PS: Be indulgent for my first contribution / question in the community!
This post originally written in French and has been translated for your convenience. When you reply, it will also be translated back to French .
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Model tuning - Optimization per line
You could probably use minimize() on your desired cost function to get the optimal value of VAR, optimizing each row in a loop. Here's how you might set something like that up:
dt = Current Data Table();
cost = expr(abs(3 * :PAR1[i] ^ 3 + Cos( 2 * :PAR1[i] ^ 2 + VAR1 ) - :MEA[i]));
for(i=1, i<=N Row(dt), i++,
:VAR[i] = Minimize(cost,{VAR1(-5, 5)});
);
Since you are only optimizing 1 error (no need to minimize a sum of squared errors), you can just use the simpler cost function of the error without squaring.
There are many more arguments that you can use with minimize(). Also check out Constrained Minimize(). This seemed to work on my test table I set up and the errors were minimized as long as I put in a reasonable value for MEA.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Model tuning - Optimization per line
You could probably use minimize() on your desired cost function to get the optimal value of VAR, optimizing each row in a loop. Here's how you might set something like that up:
dt = Current Data Table();
cost = expr(abs(3 * :PAR1[i] ^ 3 + Cos( 2 * :PAR1[i] ^ 2 + VAR1 ) - :MEA[i]));
for(i=1, i<=N Row(dt), i++,
:VAR[i] = Minimize(cost,{VAR1(-5, 5)});
);
Since you are only optimizing 1 error (no need to minimize a sum of squared errors), you can just use the simpler cost function of the error without squaring.
There are many more arguments that you can use with minimize(). Also check out Constrained Minimize(). This seemed to work on my test table I set up and the errors were minimized as long as I put in a reasonable value for MEA.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Model tuning - Optimization per line
Perfect! I did not know that these 2 functions - Minimize () and Constrained Minimize () - were existing. Thanks a lot for your help
This post originally written in French and has been translated for your convenience. When you reply, it will also be translated back to French .