-
Notifications
You must be signed in to change notification settings - Fork 6
Description
swap_observed(model, data)
call builds a new model, which is equivalent to the old model, but the existing observed object is replaced with data
.
My concern is that swap usually implies that there are two objects that exchange some of their properties, so they are both modified (see e.g. c++ std), whereas in this case the change is unidirectional.
I suggest to call this function replace_observed(model, data)
.
In principle, for single SEM models it will be enough just to have a Sem(model, data)
constructor -- I think from the user perspective it is quite logical what it should do.
But for ensemble models it would probably be less clear, whereas replace_observed
can have oberloads like replace_observed(model, id, data)
, or replace_observed(model, id => data)
,
or even replace_observed(model, id1 => data1, id2 => data2, ...)
.