def test_distribution():
    from mle import Normal, var, par
    import theano.tensor as T

    x = var('x')
    mu = par('mu')
    sigma = par('sigma')

    dist = Normal(x, mu, sigma)

    assert(len(dist.get_vars()) == 1)
    assert(len(dist.get_params()) == 2)
    assert(len(dist.get_dists()) == 0)

@@ -1,8 +1,9 @@
+%0A
 def test
@@ -7,23 +7,374 @@
 est_
-distribution():
+formula_transform():%0A    %22%22%22%0A    Check if variables can be added/multiplied/transformed.%0A    The result should be a formula that can be plugged into a model.%0A    %22%22%22%0A    from mle import var, par%0A%0A    x = var('x')%0A    a = par('a')%0A    b = par('b')%0A%0A    formula = a * x**2 + b%0A%0Adef test_simple_fit():%0A    %22%22%22%0A    Check if generating/fitting Gaussian data works%0A    %22%22%22
 %0A   
@@ -436,16 +436,39 @@
 sor as T
+%0A    import numpy as np
 %0A%0A    x 
@@ -559,122 +559,664 @@
 ma)%0A
-%0A
     
-assert(len(dist.get_vars()) == 1)%0A    assert(len(dist.get_params()) == 2)%0A    assert(len(dist.get_dists()) == 0)
+np.random.seed(42)%0A    data = dist.sample(1e6, %7B'mu': 0, 'sigma': 1%7D)%0A    results = dist.fit(%7B'x': data%7D, %7B'mu': 1, 'sigma': 2%7D, method='L-BFGS-B')%0A%0Adef test_linear_regression():%0A    %22%22%22%0A    Check if fitting a linear model works%0A    %22%22%22%0A    from mle import Normal, var, par%0A    import theano.tensor as T%0A    import numpy as np%0A%0A    x = var('x')%0A    y = var('y')%0A%0A    a = par('a')%0A    b = par('b')%0A    sigma = par('sigma')%0A%0A    dist = Normal(y, a * x + b, sigma)%0A    np.random.seed(42)%0A%0A    xs = linspace(0, 1, 20)%0A    ys = dist.sample(20, %7B'x': xs, 'a': 1, 'b': 0, 'sigma': 0.5%7D)%0A%0A    results = dist.fit(%7B'x': xs, 'y': ys%7D, %7B'a': 2, 'b': 1, 'sigma': 1%7D)%0A%0A
 %0A

Add some tests that don't pass yet