gs_quant.timeseries.econometrics.prices — gs_quant 0.1 documentation

# gs_quant.timeseries.econometrics.prices

`prices`(series, initial=1, type=<Returns.SIMPLE: 'simple'>)

  Calculate price levels from returns series

  Parameters

    - series (`Series`) – time series of returns

    - initial (`int`) – initial price level

    - type (`Returns`) – returns type: simple, logarithmic or absolute

  Return type

    `Series`

  Returns

    date-based time series of return

  Usage

  Compute price levels from returns series, based on the value of type:

  Type | Description
  --- | ---
  simple | Simple arithmetic returns
  logarithmic | Logarithmic returns
  absolute | Absolute returns

  Simple

  Compute asset price series from simple returns:

  \(Y_t = (1 + X_{t-1}) Y_{t-1}\)

  where \(X_t\) is the asset price at time \(t\) and \(Y_0 = initial\)

  Logarithmic

  Compute asset price series from logarithmic returns:

  \(Y_t = e^{X_{t-1}} Y_{t-1}\)

  where \(X_t\) is the asset price at time \(t\) and \(Y_0 = initial\)

  Absolute

  Compute asset price series from absolute returns:

  \(Y_t = X_{t-1} + Y_{t-1}\)

  where \(X_t\) is the asset price at time \(t\) and \(Y_0 = initial\)

  Examples

  Generate price series and take compute returns

      >>> series = generate_series(100)
      >>> returns = prices(returns(series))

  See also

  `returns()` `product()` `exp()`