Skip to content

unit_vector transform should work with zero-length unconstrained #2569

Open
@bob-carpenter

Description

@bob-carpenter

Description

Unit vector transforms should work with a zero-length unconstrained vector.

Example

The size-1 unit vector is just a constant [1]'. This should be the result of transforming the unconstrained 0-vector []'.

Expected Output

Stan programs that use:

parameters {
  unit_vector[1] alpha;
}

should lead to alpha == [1]'.

Current Version:

v4.1.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions