Solving inverse problems with PyMC

前端 未结 2 1469
Happy的楠姐
Happy的楠姐 2020-12-15 00:43

Suppose we\'re given a prior on X (e.g. X ~ Gaussian) and a forward operator y = f(x). Suppose further we have observed y

2条回答
  •  不知归路
    2020-12-15 01:17

    The problem is that your function, $y = x^2$, is not one-to-one. Specifically, because you lose all information about the sign of X when you square it, there is no way to tell from your Y values whether you originally used 2 or -2 to generate the data. If you create a histogram of your trace for X after just the first iteration, you will see this:histogram of trace after first iteration

    This distribution has 2 modes, one at 2 (your true value) and one at -2. At the next iteration, x.mean() will be close to zero (averaging over the bimodal distribution), which is obviously not what you want.

提交回复
热议问题