locked
Apply a factor on each element of a jaggedArray RRS feed

  • Question

  • Hello,

    I want to follow this example to tell infer.NET that my variables come from a certain distribution. Like this example:

     Variable.ConstrainEqualRandom(jaggedArray[xRAnge][yRange][zRange], observationDistribs[xRange][yRange][zRange]);

    I have a jagged array. So I first define a jagged array (observationDistributions) of type Gaussian, and set its observedvalue to the array of proper Gaussians that I need. my jagged array is defined like this :

    sum = Variable.sum(variableArray1 * VariableArray2);

    jaggedArray[xRange][yRange][zRange] = Variable.GaussianFromMeanAndPrecision(sum , noise)

    And noise itself is a variable with a broad Gamma prior. (The above lines are inside foreach block over three ranges)

    I create my model and in running there is a problem :

    GaussianProductOp.AAverageConditional(array_B[xRange][yRange][zRange], array_Rep2_F[xRange][zRange][yRange], inputData_1_zIndices_F[yRange][xRange][zRange]) has quality band Experimental which is  less than the recommended quality band (Preview) done.
    An unhandled exception of type 'System.Exception' occurred in Infer.Runtime.dll
    Additional information: quadrature failed

    can anyone help me what can the problem be?

    When instead of ConstrainEqualRandom I set observedValue to mean of this distribution it works (And it should not work in theory, because these values are not observed to this means, but they are a sample of the distribution with this noise). But it seems because the multiply itself is noisy, then introducing a noisy variable (instead of observed) is then a problem. Can you please help me? Am I thinking correctly?


    • Edited by RazinR Wednesday, February 4, 2015 10:32 PM
    Wednesday, February 4, 2015 10:00 PM

Answers

  • The error message tells you that it is a problem with GaussianProductOp.  You can either switch to a different inference algorithm or change the implementation of GaussianProductOp, as done in the Recommender System example.
    • Marked as answer by RazinR Monday, February 9, 2015 4:03 PM
    Thursday, February 5, 2015 12:27 PM
    Owner