create.declaration: Creates variable declarations for Stan programs

Description Usage Arguments Details Value Examples

Description

Creates variable declarations for Stan programs

Usage

1
create.declaration(var.name, var.type, var.dim)

Arguments

var.name

String indicating the name of the variable

var.type

String indicating the variable type and any restrictions

var.dim

String or number indicating the dimension of the variable

Details

This method allows for easy creation of variable declarations, accounting for semantic differences in declaring vectors vs. arrays.

If var.dim is a string, it should be in the form of dimension declarations in a Stan program (e.g., "[N, k]").

Value

A string for the resulting variable declaration.

Examples

1
2
3
create.declaration("foo", "real<lower=0>", 5)
create.declaration("bar", "vector", "[k]")
create.declaration("mat", "matrix", "[N, k]")

tkmckenzie/ikde documentation built on May 13, 2019, 9:53 p.m.