locked
Another error - improper distribution (Migrated from community.research.microsoft.com) RRS feed

  • Question

  • Ravi Pandya posted on 08-15-2010 8:22 AM

    Again, I'm not sure what I'm doing that is causing this error. I've tried a few variations in configuring the model, as well as using InitialiseTo() on the variable array (rnaEndLevel) that appears to be causing the problem, but to no avail. Please let me know if you have any suggestions. Thanks,

    Ravi

    ---

    MicrosoftResearch.Infer.Distributions.ImproperDistributionException was unhandled
      Message=The distribution is improper (Gaussian.Uniform). Cannot compute expectations.
      Source=Infer.Runtime
      StackTrace:
           at MicrosoftResearch.Infer.Distributions.Gaussian.GetAverageLog(Gaussian that) in C:\infernetBuilds\12-11-2009_17-18\Runtime\Distributions\Gaussian.cs:line 323
           at MicrosoftResearch.Infer.Factors.GateExitOp.CasesAverageLogarithm[T,BernoulliList](T exit, IList`1 values, BernoulliList result) in C:\infernetBuilds\12-11-2009_17-18\Runtime\Factors\GateExit.cs:line 373
           at MicrosoftResearch.Infer.Models.User.Model0_VMP.Update() in c:\Users\ravip\Documents\Extreme\Dream\Stitch\Test\bin\Debug\GeneratedSource\Model0_VMP.cs:line 5016
           at MicrosoftResearch.Infer.CompiledAlgorithm.Update() in C:\infernetBuilds\12-11-2009_17-18\Compiler\Infer\Algorithms\CompiledAlgorithm.cs:line 308
           at MicrosoftResearch.Infer.CompiledAlgorithm.Update(Int32 numberOfIterations) in C:\infernetBuilds\12-11-2009_17-18\Compiler\Infer\Algorithms\CompiledAlgorithm.cs:line 288
           at MicrosoftResearch.Infer.CompiledAlgorithm.Execute(Int32 numberOfIterations) in C:\infernetBuilds\12-11-2009_17-18\Compiler\Infer\Algorithms\CompiledAlgorithm.cs:line 80
           at MicrosoftResearch.Infer.CompiledAlgorithm.Execute() in C:\infernetBuilds\12-11-2009_17-18\Compiler\Infer\Algorithms\CompiledAlgorithm.cs:line 70
           at MicrosoftResearch.Infer.InferenceEngine.InferAll(Boolean inferOnlySpecifiedVars, IEnumerable`1 vars) in C:\infernetBuilds\12-11-2009_17-18\Compiler\Infer\InferenceEngine.cs:line 348
           at MicrosoftResearch.Infer.InferenceEngine.Infer(IVariable var) in C:\infernetBuilds\12-11-2009_17-18\Compiler\Infer\InferenceEngine.cs:line 131
           at MicrosoftResearch.Infer.InferenceEngine.Infer[TReturn](IVariable var) in C:\infernetBuilds\12-11-2009_17-18\Compiler\Infer\InferenceEngine.cs:line 194
           at Stitch.Model.Infer(Observation[] observations, Double edgeInfluenceMean) in C:\Users\ravip\Documents\Extreme\Dream\Stitch\Stitch\Model.cs:line 551
           at Test.Program.Main(String[] args) in C:\Users\ravip\Documents\Extreme\Dream\Stitch\Test\Program.cs:line 106
           at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
           at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
           at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
           at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ThreadHelper.ThreadStart()
      InnerException:

    This is the generated code near the error:

                    // Message to 'rnaEndLevel1_observations_cond_model_1_uses' from ReplicateWithMarginal factor
                    this.rnaEndLevel1_observations_cond_model_1_uses_F[observations][0] = ReplicateOp.UsesAverageLogarithm<Gaussian,Gaussian>(this.rnaEndLevel1_observations_cond_model_1_F[observations], 0, this.rnaEndLevel1_observations_cond_model_1_uses_F[observations][0]);
                    if (!hasTimeSeries[observations])
                    {
                        // Message to 'rnaEndLevel1_observations_cond_model' from Copy factor
                        this.rnaEndLevel1_observations_cond_model_F[observations][1] = CopyOp<double>.OutputAverageLogarithm<Gaussian>(this.rnaEndLevel1_observations_cond_model_1_uses_F[observations][0]);
                    }
                    // Message to 'model_cases_rep2_uses' from Exit factor
                    this.model_cases_rep2_uses_B[0][observations] = GateExitOp.CasesAverageLogarithm<Gaussian,DistributionStructArray<Bernoulli,bool>>(this.rnaEndLevel1_B[observations], this.rnaEndLevel1_observations_cond_model_F[observations], this.model_cases_rep2_uses_B[0][observations]); // <-- exception thrown here

    Friday, June 3, 2011 5:59 PM

Answers

  • minka replied on 08-17-2010 12:43 PM

    This happens when you don't provide a valid prior distribution for a variable.  I'm guessing that hasTimeSeries[observations] is true, and so rnaEndLevel1_observations_cond_model_F is never updated by the line above.  Have you provided a definition for rnaEndLevel1 in the case hasTimeSeries=true?

    Friday, June 3, 2011 5:59 PM