Input format¶
1D input data¶
For illustration, consider a simple example 1D input data:

xis the independent variable corresponding to the bin center location, andyis the dependent variable corresponding to the bin content.y_upandy_downare the upside and downside uncertainties, respectively.- Both
y_upandy_downare the distance values from the nominal valueyand therefore are non-negative by definition. bin_widths_1dis the bin width inx.- If your data do not have uncertainty in
y, you can set bothy_upandy_downto ones with the same shape asy. This way the objective function simply becomes from chi2 to MSE. - Each of these can be either a python list or a numpy array, with the same shape of (n, 1), and they should have the same ordering in the elements.
A graphical illustration is provided below.





2D input data¶
For illustration, consider a simple example 2D input data:
x = [[-1, -1], [-1, 1], [2, -1], [2, 1], [8, -1], [8, 1]]
y = np.array([1, 2, 3, 4, 5, 6])
y_up = np.sqrt(y)
y_down = np.sqrt(y)
bin_edges_2d = [
[-2, 0, 4, 12],
[-2, 0, 2]
]

xis the independent variable corresponding to the bin center location, where each element is a 2D bin location [x0, x1], andxhas a shape of (n, 2).yis the dependent variable corresponding to the bin content and has a shape of (n, 1).- Both
y_upandy_downare the distance values from the nominal valueyand therefore are non-negative by definition, which has a shape of (n, 1). - If your data do not have uncertainty in
y, you can set bothy_upandy_downto ones with the same shape asy. This way the objective function simply becomes from chi2 to MSE. - The above can be either a python list or a numpy array.
bin_edges_2dis the bin edges for both dimensions, containing two lists where the first one is the bin edges for x0 and the second one is the bin edges for x1, including both the leftmost and rightmost bin edge locations.bin_edges_2dshould be a python list that contains two sub lists, where the first sub list is [x0_0, x0_1,...] which has (num_x0_bins + 1) elements, and the second sub list is [x1_0, x1_1,...] which has (num_x1_bins + 1) elements.- Therefore it is better not to assume a numpy array for it since (num_x0_bins + 1) =/= (num_x1_bins + 1) is possible.
A graphical illustration is provided below.


