Skip to content

Two different versions for weighted lorenz curve calculation in the examples #28534

@yonil7

Description

@yonil7

Describe the issue linked to the documentation

There are 2 definitions of (weighted) lorenz_curve() functions here and here

The difference is in the X coordinates that these functions returns. Both return X coordinates between 0 and 1, but the first example returns equally spaced X coordinates:

cumulated_samples = np.linspace(0, 1, len(cumulated_claim_amount))

and the second example return un-equally spaced X coordinates (spaced using the samples weights):

cumulated_exposure = np.cumsum(ranked_exposure)
cumulated_exposure /= cumulated_exposure[-1]

Suggest a potential alternative/fix

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions