def test_dirichlet(self): a = Numeric.arange(10) * 0.1 + 0.1 d = self.rng.dirichlet(a) array_check(d, Float, (a.shape[0],)) ra = Numeric.reshape(a, (a.shape[0], -1)) ra = Numeric.transpose(ra) p = rngmodule.dirichlet_pdf(d, ra) d = self.rng.dirichlet(a, 100) array_check(d, Float, (100, a.shape[0]))
def test_dirichlet(self): a = Numeric.arange(10) * .1 + .1 d = self.rng.dirichlet(a) array_check(d, Float, (a.shape[0], )) ra = Numeric.reshape(a, (a.shape[0], -1)) ra = Numeric.transpose(ra) p = rngmodule.dirichlet_pdf(d, ra) d = self.rng.dirichlet(a, 100) array_check(d, Float, (100, a.shape[0]))
def setUp(self): self.dim = 100 self.param = 2 self.a = 1000.1 self.b = 100 self.x = Numeric.arange(self.dim) x = self.x self.y = self.a + self.b * self.x self.w = Numeric.ones((self.dim,)) self.ws = multifit.linear_workspace(self.dim, self.param) self.X = Numeric.transpose(Numeric.array((Numeric.ones(self.dim,), x)))
def setUp(self): self.dim = 100 self.param = 2 self.a = 1000.1 self.b = 100 self.x = Numeric.arange(self.dim) x = self.x self.y = self.a + self.b * self.x self.w = Numeric.ones((self.dim, )) self.ws = multifit.linear_workspace(self.dim, self.param) self.X = Numeric.transpose(Numeric.array( (Numeric.ones(self.dim, ), x)))
def exp_df(x, params): A = x[0] lambda_ = x[1] b = x[2] t = params[0] yi = params[1] sigma = params[2] e = exp(-lambda_ * t) e_s = e / sigma df = Numeric.array((e_s, -t * A * e_s, 1 / sigma)) df = Numeric.transpose(df) return df
def exp_df(x, params): A = x[0] lambda_ = x[1] b = x[2] t = params[0] yi = params[1] sigma = params[2] e = exp(-lambda_ * t) e_s = e/sigma df = numx.array((e_s, -t * A * e_s, 1/sigma)) df = numx.transpose(df) return df