Empirical Intervals Toolbox

empirical_intervals.distribute_color_spectrum(nds, cmap)

Distribute color spectrum

Evenly distribution color palette across nds data sets.

Input:
Returns:
  • psty (array): [nds x 3] - RGB distributed across color map
empirical_intervals.fillyy(x, y1, y2, col, trans)

Fill interval between two lines, (x, y1) and (x, y2)

Fills space between lines. Calling fillyy(x,y1,y2,col) will fill space between lines (x,y1) and (x,y2) with color col

Input:
  • x (array): independent variable
  • y1 (array): y value of first line
  • y2 (array): y value of second line
  • col (array): color to use in fill command
  • trans (scalar): Transparency level [0,1].
Returns:
  • h (handle): Figure handle
empirical_intervals.generate_empirical_intervals(f, limits)

Generate Empirical Intervals

Generates empirical intervals based on a set of model responses (f). The intervals limits require a specific form:

limits = [left1, left2, ..., center, ..., right2, right1]

There should be an odd number of elements in ‘limits’. If the center is 0.5, this will correspond to the middle row (or interpolated middle row) of the sorted model responses. Note, the model responses will be sorted in a column wise fashion.

Example: This corresponds to 99%, 95%, 90%, and 50% intervals with median/mean model response denoted by 0.5 (center).

limits = [0.005,0.025,0.05,0.25,0.5,0.75,0.9,0.975,0.995];
Y_empirical_intervals = generate_empirical_intervals(Y, limits);
Input:
  • f (array): Model response for various parameter sets.
  • limits (array): Bounds for empirical intervals.
Returns:
  • y (array): Empirical intervals based on limits, with median model response
empirical_intervals.plot_empirical_intervals(time, intervals, inputsettings)

Plot Empirical Intervals

Settings for plotting empirical intervals

inputsettings
  • colorscheme: gradient or spectrum;
  • gradient:
    • initialcolor: [r,g,b] - dimmest (lightest) color
  • spectrum:
    • colormap: jet, parula, hsv, etc. (see MathWorks)
  • figID: specify figure handle - leave empty to generate new figure;
  • transparency_level: # number between 0 (translucent) and 1 (opaque);
  • meanmodelstyle: plot style/color for mean model response

Example:

settings.colorscheme = 'gradient';
settings.initial_color = [0.5, 0.9, 0.7];
[mh, fillh] = plot_empirical_intervals(P, Y_empirical_intervals, settings);
Input:
Returns:
  • medianhandle (handle): handle of median plot line
  • fillhandle (handle): handle for fill plots
  • settings (struct): actual settings used to generate plot