Skip to content

inconsistent use of row- vs. column-major ordering of node names #1620

Description

@paciorek

I'm surprised this hasn't come up (perhaps it has).

getDependencies and getNodeNames use row-major ordering while expandNodeNames uses column-major.

code <- nimbleCode({
  for(i in 1:2)
    for(j in 1:3)
      y[i,j]~dnorm(mu,1)
  mu ~ dnorm(0,1)
})

m <- nimbleModel(code)
m$getNodeNames()
m$expandNodeNames('y')
m$getDependencies('mu')
[1] "mu"      "y[1, 1]" "y[1, 2]" "y[1, 3]" "y[2, 1]" "y[2, 2]" "y[2, 3]"
[1] "y[1, 1]" "y[2, 1]" "y[1, 2]" "y[2, 2]" "y[1, 3]" "y[2, 3]"
[1] "mu"      "y[1, 1]" "y[1, 2]" "y[1, 3]" "y[2, 1]" "y[2, 2]" "y[2, 3]"

Given nimble 2.0, I think this is mainly a curiosity at this point.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions