(function (global, factory) {
  if (typeof define === "function" && define.amd) {
    define(["exports", "rxjs/operators", "./variance"], factory);
  } else if (typeof exports !== "undefined") {
    factory(exports, require("rxjs/operators"), require("./variance"));
  } else {
    var mod = {
      exports: {}
    };
    factory(mod.exports, global.operators, global.variance);
    global.stdev = mod.exports;
  }
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _operators, _variance2) {
  "use strict";

  Object.defineProperty(_exports, "__esModule", {
    value: true
  });
  _exports.default = void 0;
  _variance2 = _interopRequireDefault(_variance2);

  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

  const stdev = function stdev(initialState, sample = true, _variance = _variance2.default) {
    return source$ => source$.pipe(_variance(initialState || {
      index: 0,
      mean: 0,
      m2: null
    }, sample), (0, _operators.map)(myVariance => Math.sqrt(myVariance)));
  };

  var _default = stdev;
  _exports.default = _default;
});
//# sourceMappingURL=stdev.js.map