title: Figaro probabilistic programming parameter learning
body: <p>I've currently started studying graphical probabilistic models. I've read the book "Practical Probabilistic Programming" by Avi Pfeffer about the Figaro probabilistic programming language. As an exercise I'm trying to learn the parameters of a normal distribution from a learning set. Anyway the data that I obtain isn't quite what is reasonable to expect.<br>
  I've defined a model where the normal distribution depends on 2 paramenters: The mean is another normal distribution with a mean of 50 and a variance of 0.01. The variance is a gamma distribution ok k=2 and theta=2.<br>
  I'm making 100 observation each with a value of 100. I'm inferring the mean and the variance with an Importance sampling algorithm. 
  Here is the code</p>
  
  <pre><code>val mean : Element[Double] = Normal(50,0.01)
  val variance: Element[Double] = Gamma(2,2)
  val tripDistances = for(i&lt;-Range(1,100)) yield Chain(mean, variance,(m:Double, v:Double) 
      =&gt; Normal(mean,variance))
  for {t &lt;- tripDistances} {t.observe(100) }
  var importance = Importance(10000, mean,variance)
  importance.start()
  val expectedMeanVal = importance.computeExpectation(mean, (m: Double) =&gt; m)
  val expectedVarianceVal = importance.computeExpectation(variance, (v: Double) =&gt; v)
  importance.kill()
  println("the mean = " + expectedMeanVal)
  println("the variance = " + expectedVarianceVal)
  </code></pre>
  
  <p>Here is the output:</p>
  
  <pre><code>the mean = 49.905560193556994
  the variance = 23.82362490526008
  </code></pre>
  
  <p>It is like the observation have no effect whatsoever on the probability distribution of the parameters. This is rather odd (surely i'm missing something), since i'm chaining the two elements (mean and variance) to create the normal distribution for which I then observe the actual values. 
  I hope somebody could help me out. 
  Thanks. </p>