common_to_all_curves[source]

common_to_all_curves(curve_type, get_info, *varargin)

Fetches information that is common to all curves

This class of helper functions provides information that is common to all family of curves (in case you have multiple families of curves) like initial uniform sampling, checks to see if curve parameters exceed bounds, and so on. Following a convention from the MATLAB implementation of the toolbox, this main 'control' function directs input to one of several subfunctions based on specified arguments.

Arguments:

  • curve_type: Family of curves, string, e.g. 'free_rmpw'
  • get_info: Cues for specific information / computation, string, e.g. 'initial_sampling'
  • varargin: Has arguments depending on the computation

Returns output of all computations.

Example Usage:

  • common_to_all_curves('horz_indpnt', 'initial_sampling', 1000, 4)
  • common_to_all_curves('horz_indpnt', 'check_if_exceed_bounds', some_matrix)
  • common_to_all_curves('horz_indpnt', 'curve_volumes', 5)
  • common_to_all_curves('horz_indpnt', 'flip_vertical_params', some_matrix)
  • common_to_all_curves('horz_indpnt', 'sort_horizontal_params', some_matrix)
  • common_to_all_curves('horz_indpnt', 'draw_bcm_curves', [0.2, 0.5, 0.1, 0.1, 0.1, 0.1], 4)
  • common_to_all_curves('horz_indpnt', 'auto_generate', 'con', 4)
  • common_to_all_curves('horz_indpnt', 'weighted_curve', importance_sampler_mat, 0.9, 4)

initial_sampling[source]

initial_sampling(curve_type, nParticles, resolution)

Uniformly sampling each curve parameter bounded by its respective bounds.

Arguments:

  • curve_type: type of curve, here specifying relevant bounds
  • nParticles: number of parameter particles to sample
  • resolution: number of decimals output will be rounded to

Returns nParticles by nParams array containing sampled parameters.

check_if_exceed_bounds[source]

check_if_exceed_bounds(curve_type, params)

If a curve parameter is found to exceeding bounds then it is set to the bounds. For example, if a vertical parameter is -1.02 then it is set to -1 since -1 is the lower bound for vertical parameters.

Arguments:

  • curve_type: type of curve, here specifying number of relevant params
  • params: data matrix to be checked

Returns the modified data matrix.

curve_volumes[source]

curve_volumes(curve_type, resolution)

Applies Lebesgue measure to compute curve volume over Euclidean space for arbitrary dimensionality based on associated bounds.

flip_vertical_params[source]

flip_vertical_params(curve_type, input_params)

Flipping vertical parameters of the curve. If a y1 = -0.4, flipping it will result in 0.4.

sort_horizontal_params[source]

sort_horizontal_params(curve_type, input_params)

Ensures that x1 <= x2, especially for the horz_indpnt family of curves

draw_bcm_curve[source]

draw_bcm_curve(curve_type, input_params, resolution)

Draws a BCM curve for you.

If you passed in the input_params as con then it randomly draws a theory consistent curve; inc - theory inconsistent curve. If instead you passed in [y1, x1, x2, y2, y3, y4] into input_params then it draws a curve directly rather then randomly generating one for you.

auto_generate[source]

auto_generate(curve_type, input_params, resolution)

Generate 100 curves and randomly pick a theory consistent or inconsistent curve depending on the request.

If you passed in the input_params as con then it randomly draws a theory consistent curve; inc - theory inconsistent curve.

weighted_curve[source]

weighted_curve(curve_type)

Not supported yet.