locked
MarginalPrototype and forgotten Switch (Migrated from community.research.microsoft.com) RRS feed

  • Question

  • laura posted on 01-30-2009 9:07 AM

    Hi forum!

    I just misunderstood an error message and just in case something similar happens to one of you, here is how to do it correctly:


    Trying to compile this model...

            m.[uRange] <- Variable.Discrete(xi.[uRange])
            psi.[uRange] <- Variable.Random(alphaPsiGlobal.[m.[uRange]])

    ...the transform chain popped up and the "Channel" transformation complained "Cannot automatically determine distribution type for variable type 'Dirichlet': you must specify a MarginalPrototype for variable 'vDirichlet__2'."

     

    The true problem was that I forgot to wrap the second line in a gate / switch. The following code works without complaints...

            m.[uRange] <- Variable.Discrete(xi.[uRange])
            using (Variable.Switch(m.[uRange])) (fun _ ->
                psi.[uRange] <- Variable.Random(alphaPsiGlobal.[m.[uRange]])
                )       
       
     

    Laura

     

    P.S. Sorry for the F sharp syntax..

    Friday, June 3, 2011 4:43 PM