Skip to content

[Bug]: gempyor.statistics::llik() only returns xr.DataArrays when RMSE, Abs.Err. output should be a scalar #612

@emprzy

Description

@emprzy

Label

gempyor, bug

Priority Label

medium priority

Describe the bug/issue

The gempyor.statistics::llik() function matches a config-given objective function to the appropriate class in gempyor.objective_functions(), calculates the error metric value(s), then casts the output as an xr.DataArray. In the cases of RMSE and Absolute Error, the error metric calculation is a single value, not an array.

llik() wants to return an xr.DataArray with the same shape as gt_data, but RMSE and Absolute Error error metrics generate single number scalars, causing failures down the line. Presently, if you try to configure rmse or absolute_error into a config, a NotImplementedError is thrown, but we need to either choose to not use RMSE/Absolute Error or find a way to have modular return shape with llik() (and other dependent functions).

To Reproduce

I have temporarily disabled rmse and absolute_error as likelihood distribution options to prevent unexpected failures for users, but:
See lines ~235-257 of statistics.py , as well as commented return values for objective_functions::AbsoluteError.error_metric_calculation(...) (~258) and objective_functions::RMSE.error_metric_calculation(...) (~279).

Environment, if relevant

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugDefects or errors in the code.gempyorConcerns the Python core.medium priorityMedium priority.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions