Message Boards Message Boards

Invalid Input error and a result from NExpectation

Posted 1 month ago

Can someone please tell me why I am getting an invalid input message for the first computation (even though it returns a value) and not the second.

POSTED BY: Paul Studtmann
5 Replies
Posted 1 month ago

I'm not sure I understand your comment. In my examples, the input that generates the error has a condition: r>p>(1/2t^2+1/2s^2)^(1/2). The input that does not generate the error has a simpler condition: r>(1/2t^2+1/2s^2)^(1/2). Why would adding the extra clause in the first condition generate an error?

POSTED BY: Paul Studtmann

I didn't have time to look into the successful call. In the call that fails, it appears that right after MultivariateProductParsing fails, the message is printed.

I'd suggest asking Wolfram support. They have sometimes been able to suggest fixes that I didn't know existed. Perhaps there is something about the condition in the Conditioned expression. Or perhaps it's an edge-case that trips a bug, which they would want to fix.

POSTED BY: Michael Rogers
Statistics`NExpectationDump`MultivariateProductParsing //
 GeneralUtilities`PrintDefinitions

seems to indicate that ProductDistribution is supported only if Conditioned is absent.

I think Gianluca's example has a different issue in that x>1 is not in the domain of the distribution.

POSTED BY: Michael Rogers
Posted 1 month ago

Thank you for your reply. The same thing happens with the example I gave. If the input is Expectation rather than NExpectation, there is no 'invalid input' error. In both cases, the output is the same. So, I am not concerned about the output. But, I am wondering why there is the error message for the NExpectation input.

POSTED BY: Paul Studtmann

Here is a simpler input with the same problem:

NExpectation[1 \[Conditioned] x > 1,
 {x, y} \[Distributed] DirichletDistribution[{1, 3, 4}]]

while the following works fine:

Expectation[1 \[Conditioned] x > 1,
 {x, y} \[Distributed] DirichletDistribution[{1, 3, 4}]]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract