gs_quant.timeseries.algebra.weighted_sum — gs_quant 0.1 documentation

# gs_quant.timeseries.algebra.weighted_sum

`weighted_sum`(series, weights)

  Calculate a weighted sum.

  Parameters

    - series (`List`[`Series`]) – list of time series

    - weights (`list`) – list of weights

  Return type

    `Series`

  Returns

    time series of weighted average

  Usage

  Calculate a weighted sum e.g. for a basket.

  Examples

  Generate price series and get a sum (weights 70%/30%).

      >>> prices1 = generate_series(100)
      >>> prices2 = generate_series(100)
      >>> mybasket = weighted_sum([prices1, prices2], [0.7, 0.3])

  See also

  `basket()`