UNPKG

@stdlib/stats-base-dists-negative-binomial-ctor

Version:

Negative binomial distribution constructor.

6 lines (5 loc) 2.57 kB
"use strict";var g=function(e,t){return function(){return t||e((t={exports:{}}).exports,t),t.exports}};var v=g(function(O,f){ var o=require('@stdlib/assert-is-probability/dist').isPrimitive,p=require('@stdlib/utils-define-property/dist'),s=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),n=require('@stdlib/utils-define-nonenumerable-read-only-accessor/dist'),m=require('@stdlib/assert-is-positive-number/dist').isPrimitive,h=require('@stdlib/stats-base-dists-negative-binomial-kurtosis/dist'),l=require('@stdlib/stats-base-dists-negative-binomial-mean/dist'),c=require('@stdlib/stats-base-dists-negative-binomial-mode/dist'),q=require('@stdlib/stats-base-dists-negative-binomial-skewness/dist'),y=require('@stdlib/stats-base-dists-negative-binomial-stdev/dist'),b=require('@stdlib/stats-base-dists-negative-binomial-variance/dist'),d=require('@stdlib/stats-base-dists-negative-binomial-cdf/dist'),w=require('@stdlib/stats-base-dists-negative-binomial-logpmf/dist'),P=require('@stdlib/stats-base-dists-negative-binomial-mgf/dist'),B=require('@stdlib/stats-base-dists-negative-binomial-pmf/dist'),M=require('@stdlib/stats-base-dists-negative-binomial-quantile/dist'),u=require('@stdlib/error-tools-fmtprodmsg/dist');function k(e){return d(e,this.r,this.p)}function E(e){return w(e,this.r,this.p)}function F(e){return P(e,this.r,this.p)}function T(e){return B(e,this.r,this.p)}function V(e){return M(e,this.r,this.p)}function r(){var e,t;if(!(this instanceof r))return arguments.length===0?new r:new r(arguments[0],arguments[1]);if(arguments.length){if(e=arguments[0],t=arguments[1],!m(e))throw new TypeError(u('15b99',e));if(!o(t))throw new TypeError(u('15b8m',t))}else e=1,t=.5;return p(this,"r",{configurable:!1,enumerable:!0,get:function(){return e},set:function(i){if(!m(i))throw new TypeError(u('15b8k',i));e=i}}),p(this,"p",{configurable:!1,enumerable:!0,get:function(){return t},set:function(i){if(!o(i))throw new TypeError(u('15b8o',i));t=i}}),this;}n(r.prototype,"kurtosis",function(){return h(this.r,this.p)});n(r.prototype,"mean",function(){return l(this.r,this.p)});n(r.prototype,"mode",function(){return c(this.r,this.p)});n(r.prototype,"skewness",function(){return q(this.r,this.p)});n(r.prototype,"stdev",function(){return y(this.r,this.p)});n(r.prototype,"variance",function(){return b(this.r,this.p)});s(r.prototype,"cdf",k);s(r.prototype,"logpmf",E);s(r.prototype,"mgf",F);s(r.prototype,"pmf",T);s(r.prototype,"quantile",V);f.exports=r });var x=v();module.exports=x; /** @license Apache-2.0 */ //# sourceMappingURL=index.js.map