docs icon indicating copy to clipboard operation
docs copied to clipboard

truncation correction should be subtracted in example

Open bob-carpenter opened this issue 1 year ago • 0 comments

Summary:

User Aboottogo in this post, reported an error in an example here:

https://mc-stan.org/docs/stan-users-guide/one-dimensional-integrals.html

Description:

[quote="Aboottogo, post:1, topic:36958"]

  target += normal_lpdf(y | mu, sigma);
  target += log(integrate_1d(normal_density,
                             left_limit,
                             positive_infinity(),
                             { mu, sigma }, x_r, x_i));

[/quote]

The example is left truncated, so this should be a subtraction of the log of the integral as it's in the denominator.

Additional Information:

Provide any additional information here.

bob-carpenter avatar Oct 21 '24 18:10 bob-carpenter