convert Variable<double>[] to Variable<vector>? RRS feed

  • Question

  • Ho to do this:

    I found that Vector can be formed in this way:

    Variable<double[]> emi2;
    emi2 = Variable.New<double[]>();
    but how to copy a Variable<double>[] to a Vector variable (each member of the vector is the corresponding variable in double variable array)?

    The goal is using the vector as mean to get a multivariate Gaussian emission.  can anyone suggest other ways to do this?


    Monday, July 2, 2012 1:42 PM


  • I suggest creating a Vector variable using Variable.VectorGaussian with zero mean and large variance, then applying a series of constraints to make each element of the vector equal to the corresponding element of the array.  The constraints can be written using Variable.ConstrainEqual or Variable.GaussianFromMeanAndVariance, depending on which inference algorithm you want to use.  A similar technique was used in another thread.
    • Marked as answer by invisible911 Tuesday, July 3, 2012 12:29 PM
    Monday, July 2, 2012 4:15 PM