# Why is there significant difference between these two methods in prediction?

**URL:** <https://discourse.edwardlib.org/t/why-is-there-significant-difference-between-these-two-methods-in-prediction/264>\
**Category:** General\
**Created:** [July 28, 2017, 9:07am UTC](https://discourse.edwardlib.org/t/why-is-there-significant-difference-between-these-two-methods-in-prediction/264 "2017-07-28T09:07:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![edisoncruise](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@edisoncruise](https://discourse.edwardlib.org/u/edisoncruise)\
**Post date:** [July 28, 2017, 9:07am UTC](https://discourse.edwardlib.org/t/why-is-there-significant-difference-between-these-two-methods-in-prediction/264/1 "2017-07-28T09:07:52Z")

</div>

I am using Bayesian linear regression y=beta_X+alpha for prediction. After inference, I tried to used 2 methods:  
(1) y\_post.eval(feed\_dict={X\_in: X4pre})  
(2) I first evaluate the mean value of beta and alpha by beta\_post.mean().eval() and alpha\_post.mean().eval(), then use the equation y=beta_X+alpha to calculate the mean of y.  
The predicted mean of y are quite close when I run the tutorial example: [http://edwardlib.org/tutorials/supervised-regression](http://edwardlib.org/tutorials/supervised-regression)  
But when I tried to feed the model with some real noisy data from financial market, the predicted mean of y is quite different between these two methods. Is there any clue to solve this problem?

---

<div class="post-metadata">

**Author:** ![edisoncruise](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@edisoncruise](https://discourse.edwardlib.org/u/edisoncruise)\
**Post date:** [August 1, 2017, 2:40am UTC](https://discourse.edwardlib.org/t/why-is-there-significant-difference-between-these-two-methods-in-prediction/264/2 "2017-08-01T02:40:43Z")

</div>

I find the problem. I am using SGHMC for inference. It seems that Edward does not implement a 'burn in ’ method as defaul in y\_post.eval(), beta\_post.mean(), and alpha\_post.mean(). If I output all the samples of beta\_post and alpha\_post and drop the initial hundreds samples the results are exactly the same, but both different from y\_post.eval(). It seems there is some problme when using y\_post.eval()
