Ejemplo n.º 1
0
 def testParameterEstimation(self):
     
     mu, alpha, beta = -0.04, 2.11, 1.90
     data = [-1.1712, -2.5608, -0.7143, 2.6218, -2.0655, 0.7544, 1.208, -0.5289, 0.0045, 1.1746,
             -1.0766, 1.1198, 1.2785, -0.6051, 2.2913, -3.6672, -0.2525, 0.8782, -0.0617, -0.0239]
     
     pdf = GeneralizedNormal(1, 1, 1)
     pdf.estimate(data)
     
     self.assertAlmostEqual(pdf.mu, mu, places=2)
     self.assertAlmostEqual(pdf.alpha, alpha, places=2)
     self.assertAlmostEqual(pdf.beta, beta, places=1) 
Ejemplo n.º 2
0
    def testParameterEstimation(self):

        mu, alpha, beta = -0.04, 2.11, 1.90
        data = [
            -1.1712, -2.5608, -0.7143, 2.6218, -2.0655, 0.7544, 1.208, -0.5289,
            0.0045, 1.1746, -1.0766, 1.1198, 1.2785, -0.6051, 2.2913, -3.6672,
            -0.2525, 0.8782, -0.0617, -0.0239
        ]

        pdf = GeneralizedNormal(1, 1, 1)
        pdf.estimate(data)

        self.assertAlmostEqual(pdf.mu, mu, places=2)
        self.assertAlmostEqual(pdf.alpha, alpha, places=2)
        self.assertAlmostEqual(pdf.beta, beta, places=1)