Subscribe Bookmark RSS Feed

"Dynamic Reference Line"?

mjoner

Community Trekker

Joined:

Jun 23, 2011

Is there a way to modify a Profiler so that when certain variables are changed, a y-axis reference line is drawn at a specific location?

More specifically I have a Profiler modeling y = f(x,z) where x are control variables and z are variables that are usually noise but which I can control in the right environment. I have a comparison/reference value y' = g(z) and know that the reference will change if certain noise variables increase or decrease.

Right now the only way I can think of to do this is to create a Profiler on (y-y') by making a new formula, but then my end users have to know that the y-variable in this new Profiler is not measuring raw outcome but is rather measuring the delta of y relative to the reference, and I worry that this could be confusing. Are there other options?

1 ACCEPTED SOLUTION

Accepted Solutions
David_Burnham

Super User

Joined:

Jul 13, 2011

Solution

Not sure this is helpful or not depending on if I understood your question

The Set Script message for the profiler allows you to assign a callback function which is invoked whenever a variable is changed.  Below I set the ref line to be 50 times the value of the "Silica" whenever a variable is changed

dt = Open( "$SAMPLE_DATA/Tiretread.jmp" );

prof = Profiler(

    Y(:Pred Formula HARDNESS),

    SendToReport(

        Dispatch(

            {"Prediction Profiler"},

            "10000",

            ScaleBox,

            {Min( 100 ), Max( 20 ), Inc( 5 ), Minor Ticks( 1 )}

        )

    )

);

prof << Set Script( CallBack() );

CallBack = Function({settings},{Default Local},

   

    silicaValue = Get Silica(settings);

    show(silicaValue);

    rep = prof << Report;

    refLineValue = 50*silicaValue;

    Try(

        rep[AxisBox(1)] << Remove Ref Line(::lastValue)

    );

    rep[AxisBox(1)] << Add Ref Line(refLineValue);

    ::lastValue = refLineValue;

   

);

Get Silica = Function({settings},{Default Local},

   

    For (i=1,i<=NItems(settings),i++,

        item = Char(settings[i]);

        varName = Word(1,item," = ");

        If (varName == "SILICA",

            value = Word(2,item," = ");

        )

    );

    Num(value)

   

)

-Dave
1 REPLY
David_Burnham

Super User

Joined:

Jul 13, 2011

Solution

Not sure this is helpful or not depending on if I understood your question

The Set Script message for the profiler allows you to assign a callback function which is invoked whenever a variable is changed.  Below I set the ref line to be 50 times the value of the "Silica" whenever a variable is changed

dt = Open( "$SAMPLE_DATA/Tiretread.jmp" );

prof = Profiler(

    Y(:Pred Formula HARDNESS),

    SendToReport(

        Dispatch(

            {"Prediction Profiler"},

            "10000",

            ScaleBox,

            {Min( 100 ), Max( 20 ), Inc( 5 ), Minor Ticks( 1 )}

        )

    )

);

prof << Set Script( CallBack() );

CallBack = Function({settings},{Default Local},

   

    silicaValue = Get Silica(settings);

    show(silicaValue);

    rep = prof << Report;

    refLineValue = 50*silicaValue;

    Try(

        rep[AxisBox(1)] << Remove Ref Line(::lastValue)

    );

    rep[AxisBox(1)] << Add Ref Line(refLineValue);

    ::lastValue = refLineValue;

   

);

Get Silica = Function({settings},{Default Local},

   

    For (i=1,i<=NItems(settings),i++,

        item = Char(settings[i]);

        varName = Word(1,item," = ");

        If (varName == "SILICA",

            value = Word(2,item," = ");

        )

    );

    Num(value)

   

)

-Dave