Esempio n. 1
0
	def ksmetric(self, **kwargs):
		"""
		Return the kolmogorov-smirnov metric for lognormal
		Input:
		**kwargs:
			points = [set of points to compute the cdf]
			-or-
			cdf = [Already computed cdf]

		Output:
			ks metric
		"""
		c = None
		if "cdf" in kwargs:
			c = kwargs["cdf"]
		else:
			p = kwargs["points"]
			p.sort()
			c = util.ecdf(p, issorted=True)
		
		y = self.cdf(c[:,0])
		return util.kstest(c[:,1],c[:,2],y)
Esempio n. 2
0
    def ksmetric(self, **kwargs):
        """
		Return the kolmogorov-smirnov metric for lognormal
		Input:
		**kwargs:
			points = [set of points to compute the cdf]
			-or-
			cdf = [Already computed cdf]

		Output:
			ks metric
		"""
        c = None
        if "cdf" in kwargs:
            c = kwargs["cdf"]
        else:
            p = kwargs["points"]
            p.sort()
            c = util.ecdf(p, issorted=True)

        y = self.cdf(c[:, 0])
        return util.kstest(c[:, 1], c[:, 2], y)
Esempio n. 3
0
	def ksmetric(self, **kwargs):
		"""
		Return the ks metris for truncated pareto
		Input:
		**kwargs:
			points = [set of points]
			-or-
			cdf = [Precomputed cdf]

		Output:
			KS metric
		"""

		c = None
		if "cdf" in kwargs:
			c = kwargs["cdf"]
		else:
			p = kwargs["points"]
			p.sort()
			c = util.ecdf(p, issorted=True)
		
		y = self.cdf(c[:,0])
		return util.kstest(c[:,1],c[:,2],y)
Esempio n. 4
0
    def ksmetric(self, **kwargs):
        """
		Return the ks metris for truncated pareto
		Input:
		**kwargs:
			points = [set of points]
			-or-
			cdf = [Precomputed cdf]

		Output:
			KS metric
		"""

        c = None
        if "cdf" in kwargs:
            c = kwargs["cdf"]
        else:
            p = kwargs["points"]
            p.sort()
            c = util.ecdf(p, issorted=True)

        y = self.cdf(c[:, 0])
        return util.kstest(c[:, 1], c[:, 2], y)