locked
INFER.NET factors - with non-Gaussian (beta) distributions RRS feed

  • Question

  • Hi everybody,

    I have a graphical model in which there are variables which are not Gaussian. There are some factor nodes in the graph - like factor.Multiply , etc. When I run the inference, I just get an error since these variables are not Gaussian distributed.

    For example the small code below in not compiled:

               
    Variable<double> A = Variable.BetaFromMeanAndVariance(0.4, 0.3);
    Variable<double> B = Variable.BetaFromMeanAndVariance(0.5,0.2);
    Variable<double> C = A * B;
    InferenceEngine engine = new InferenceEngine();
    Console.WriteLine(engine.Infer<Beta>(C));

    Now the problem is that I cannot change the distribution to Gaussian in my model. I wanted to ask if I should just transfer to another tool (which I think there is no other tool implementing EP) or there is a way to handle this? These factors should work on other distributions, I mean I didn't find anything in the documents saying they don't . I don't know what is the source of this error maybe.
    Thanks a lot for your help.

    (this is the error message: 

    Error 0: This model is not supported with ExpectationPropagation due to Factor.Product(double product, double a, double b). Try using a different algorithm or expressing the model differently in
    Factor.Product(vdouble0_use, vdouble1_use)
    Details: [0] System.ArgumentException: Beta is not of type Gaussian for argument 1 of method GaussianProductOp.ProductAverageConditional(Gaussian Product = Beta, Gaussian A = Beta, Gaussian B = Beta)

    [1] System.ArgumentException: Beta is not of type double for argument 1 of method GaussianProductOp.ProductAverageConditional(double A = Beta, Gaussian B = Beta)
    [2] System.ArgumentException: Beta is not of type Gaussian for argument 1 of method GaussianProductOp.ProductAverageConditional(Gaussian A = Beta, double B = Beta)
    [3] System.ArgumentException: Beta is not of type double for argument 1 of method GaussianProductOp.ProductAverageConditional(double a = Beta, double b = Beta)
    [4] System.ArgumentException: Beta is not of type Gaussian for argument 1 of method GaussianProductOp_SHG09.ProductAverageConditional(Gaussian A = Beta, Gaussian B = Beta, Gaussian to_A = Beta, Gaussian to_B = Beta)).

    I would appreciate any help.






    • Edited by RazinR Friday, June 13, 2014 8:06 AM
    Tuesday, June 10, 2014 3:39 PM

Answers

  • Infer.NET doesn't support multiplication of Beta-distributed variables at the moment.  So you will have to use another tool for this type of model.
    • Marked as answer by RazinR Friday, June 13, 2014 8:04 AM
    Thursday, June 12, 2014 1:53 PM
    Owner

All replies

  • Infer.NET doesn't support multiplication of Beta-distributed variables at the moment.  So you will have to use another tool for this type of model.
    • Marked as answer by RazinR Friday, June 13, 2014 8:04 AM
    Thursday, June 12, 2014 1:53 PM
    Owner
  • Thanks a lot for your reply.
    Friday, June 13, 2014 8:04 AM