Skip to content
LQM Registry / deterministic

Weighted Sum

Deterministic weighted aggregation with explicit weights and reproducible arithmetic.

Model keylq.math.weighted-sum
Version1.0.0
Runtimephp-native
Model contract

Inputs are explicit.

{
    "type": "object",
    "required": [
        "values"
    ],
    "properties": {
        "values": {
            "type": "array",
            "items": {
                "type": "number"
            },
            "minItems": 1
        },
        "weights": {
            "type": "array",
            "items": {
                "type": "number"
            }
        }
    }
}
Output contract

Outputs are explicit.

{
    "type": "object",
    "properties": {
        "count": {
            "type": "integer"
        },
        "weighted_sum": {
            "type": "number"
        },
        "sum_weights": {
            "type": "number"
        },
        "weighted_mean": {
            "type": [
                "number",
                "null"
            ]
        }
    }
}
Default parameters
[]
Example input
{
    "values": [
        10,
        20,
        30
    ],
    "weights": [
        0.200000000000000011102230246251565404236316680908203125,
        0.299999999999999988897769753748434595763683319091796875,
        0.5
    ]
}
Capabilities
cpudeterministicgoverned