Skip to content

[Bug?] Use Stick breaking or other scheme instead of division by sum to avoid division by small or zero value #44

@SteveBronder

Description

@SteveBronder

For the code here

    if(maxSR | maxSTARR | CSMratio) cvxr_wts <- cvxr_wts / sum(cvxr_wts)
    cvxr_wts <- as.vector(cvxr_wts)
    cvxr_wts <- normalize_weights(cvxr_wts)

If the optimization ends up with weights that sum to near zero or zero the line that divides by the sum could cause NA or very large values. Would it be alright if I made a PR to add something like a stick breaking scheme (example here) that would avoid the division?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions