*! opl_plot_best, v5, GCerulli, 11aug2025

Title

opl_plot_best -- Plot observed versus the
maximal expected reward, observed versus optimal treatment.

Syntax

opl_plot_best varlist [,
gr_reward_train(name)
gr_action_train(name)]

were:

varlist must be an ordered list of four variables:

(1) the expected outcome (based on the training policy);

(2) the observed treatment (i.e., the training policy);

(3) the maximal expected outcome (based on the best policy);

(4) the best treatment (i.e., the optimal policy).

Description

After running opl_best_treat, the command opl_plot_best plots observed versus the maximal expected reward, and observed versus optimal treatment, using the variables generated by opl_best_treat.

Options

gr_reward_train(name) saves the reward plot (observed outcome vs. maximal expected outcome)
to a graph named name in the current working directory.

gr_action_train(name) saves the action plot (observed treatment vs. optimal treatment)
to a graph named name in the current working directory.

Remarks

The command assumes that the four variables in varlist appear in the exact order listed above.
Results are typically generated by opl_best_treat and then passed to opl_plot_best.

Examples

* After opl_best_treat has produced the needed variables:

.opl_plot_best y obs_treat y_max t_best

* Save both graphs:

.opl_plot_best y obs_treat y_max t_best, gr_reward_train(reward_train) gr_action_train(action_train)

Author

Giovanni Cerulli

IRCrES-CNR

Research Institute for Sustainable Economic Growth, National Research Council of Italy

E-mail: giovanni.cerulli@cnr.it

Also see:

opl_ma_fb, opl_ma_vf, opl_best_treat