## Adding a dollar cost to model factors

Community Trekker

Joined:

Jun 10, 2016

Hi,

I built a model, let's say, with two factors X1 and X2 and a response Y. Using a contour profiler, I can see the values of X1 and X2 that result in my target Y on a grid line. In reality, there is a dollar cost associated with each of X1 and X2 and I would like to display that cost for the X1 / X2 values that match my target Y (on the contour grid line).

Is there a trick to do this in JMP? I don't see a way to extract data on a contour profiler grid line.

I'm not sure if there's another way to associate the dollar costs of factors to the model?

1 ACCEPTED SOLUTION

Accepted Solutions

Staff

Joined:

Jun 23, 2011

Solution

JMP is pretty good at this kind of thing, since the Profiler allows simultaneous optimisation. Here's a toy example:

``````NamesDefaultToHere(1);

// Sample data
dt = NewTable("Surface with Costs",
NewColumn("x1", Formula(RandomUniform(-1, 1))),
NewColumn("x2", Formula(RandomUniform(-1, 1))),
// Maximum of 'y' is at (+1, +1)
NewColumn("y", Formula(:x1 + :x2)),
// 'x1' and 'x2' costs increase linearly
NewColumn("Total Cost", Formula(:x1 + :x2)),
);
// Maximise 'y', minimise 'Total Cost'
Column(dt, "y") << Set Property("Response Limits", {Goal( Maximize ), Importance( 1 ), Show Limits( 0 )});
Column(dt, "Total Cost") << Set Property("Response Limits", {Goal( Minimize ), Importance( 1 ), Show Limits( 0 )});

// Profiler
pr = dt << Profiler(Y( :y, :Total Cost ));
// Maximise desirability
Wait(3);
pr << maximizeDesirability;``````
2 REPLIES

Staff

Joined:

Jun 23, 2011

Solution

JMP is pretty good at this kind of thing, since the Profiler allows simultaneous optimisation. Here's a toy example:

``````NamesDefaultToHere(1);

// Sample data
dt = NewTable("Surface with Costs",
NewColumn("x1", Formula(RandomUniform(-1, 1))),
NewColumn("x2", Formula(RandomUniform(-1, 1))),
// Maximum of 'y' is at (+1, +1)
NewColumn("y", Formula(:x1 + :x2)),
// 'x1' and 'x2' costs increase linearly
NewColumn("Total Cost", Formula(:x1 + :x2)),
);
// Maximise 'y', minimise 'Total Cost'
Column(dt, "y") << Set Property("Response Limits", {Goal( Maximize ), Importance( 1 ), Show Limits( 0 )});
Column(dt, "Total Cost") << Set Property("Response Limits", {Goal( Minimize ), Importance( 1 ), Show Limits( 0 )});

// Profiler
pr = dt << Profiler(Y( :y, :Total Cost ));
// Maximise desirability
Wait(3);
pr << maximizeDesirability;``````

Community Trekker

Joined:

Jun 10, 2016

Thank you! I figured out from this script that I can simply add the cost column together with the prediction formula column when I launch the profiler.