-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Description
Would be nice to support broadcasting operation for tilde operation in the following way:
@model function mymodel(c)
y = datavar(Float64, n)
x = randomvar(n)
x .~ Normal(0.0, 1.0) # iid, unrolls to for array automatically
y .~ Normal(x, 1.0) # equivalent to 'for each y_i ~ Normal(x_i, 1.0)`
endIt should be relatively easy to implement with the built-in broadcast function.
Creating random variables from broadcasting operation with AutoVar might be challenging, not impossible though.
@model function mymodel(c)
y = datavar(Float64, n)
x = randomvar(n)
x .~ Normal(0.0, 1.0) # iid, unrolls to for array automatically
z .~ Normal(x, 1.0) # z has not been defined before, but might be created automatically
y .~ Normal(x, 1.0) # equivalent to 'for each y_i ~ Normal(x_i, 1.0)`
endMetadata
Metadata
Assignees
Labels
No labels