Skip to content

affine transform inverted in manual #207

@bob-carpenter

Description

@bob-carpenter

Summary:

See title.

Description:

The following are equivalent in the distributions over alpha and alpha_std.

parameters {
  real alpha_std
  ...
transformed parameters {
  real alpha = mu + sigma * alpha_std;
  ...
model {
  alpha_std ~ normal(0, 1);
  ...
parameters {
  real<offset = mu, multiplier = sigma> alpha;
  ...
transformed parameters {
  real alpha_std = (alpha - mu) / sigma;
  ...
model {
  alpha ~ normal(mu, sigma);
  ...

The transform is

alpha_unc = (alpha - mu) / sigma

The inverse transform (unconstraining) is

alpha = mu + sigma * alpha_unc

I checked the code in the repo stan-dev/math and it's applying the right inverse transform and Jacobian. So it's just the doc that's wrong.

Current Version:

v2.23.0

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions