locked
Add correlated noisy term to Bayesian Point Machine (Migrated from community.research.microsoft.com) RRS feed

  • Question

  • shengbo posted on 03-15-2011 9:01 AM

    Hi Team,

    I want to ask a question of adding correlated Gaussian noise to the Bayesian Point Machine example that comes with Infer.net. 

    I see that the original example uses the following code: 

    ----------------------

    double noise = 0.1;

    y[j] = Variable.GaussianFromMeanAndVariance(Variable.InnerProduct(w,x[j])

    .Named("innerProduct"),noise)>0;

    -----------------------

    If I want to add correlated Gaussian noise , could I replace the above with the following code: 

    -----------------------

    // create a multivariate Gaussian distributed random vector

    Variable<Vector> noise = Variable.VectorGaussianFromMeanAndPrecision(Vector.Zero(incomes.Length), PositiveDefiniteMatrix.Identity(incomes.Length)); 

    y[j] = Variable.GaussianFromMeanAndVariance(Variable.InnerProduct(w,x[j]).

    Named("innerProduct"),Variable.GetItem(noise,i))>0;

    -----------------------

    This does not work for Infer.net because Variable.GetItem(noise, i) is not from Gamma. Could you please give me some suggestions on how to solve this? 
    Thanks a lot,
    Shengbo 

    Friday, June 3, 2011 6:33 PM

Answers

  • shengbo replied on 03-15-2011 9:42 AM

    Thanks a lot for your quick reply. What you have written is exactly what I wanted. It solved the problem perfectly!  

    Cheers,
    Shengbo 

    Friday, June 3, 2011 6:33 PM

All replies

  • minka replied on 03-15-2011 9:34 AM

    You need to be clear on what model you are trying to implement.  I suspect that you really wanted this:

       y[j] = (Variable.InnerProduct(w,x[j]).Named("innerProduct") + Variable.GetItem(noise,i))>0;

    Friday, June 3, 2011 6:33 PM
  • shengbo replied on 03-15-2011 9:42 AM

    Thanks a lot for your quick reply. What you have written is exactly what I wanted. It solved the problem perfectly!  

    Cheers,
    Shengbo 

    Friday, June 3, 2011 6:33 PM