You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, Liesel lets you initialize a variable with a distribution without declaring it as a parameter or an observed variable. This can lead to inconsistencies in the model, such that it could be that:
i.e. the posterior is not equal to the likelihood plus the prior. This is, because the log_lik and log_prior attributes rely on the lsl.Var.parameter and lsl.Var.observed attributes to identify the variables to count for the respective values.
Possible options would be:
Add parameter: bool and observed: bool as init arguments to lsl.Var.
raise an error with both are true.
raise an error if the variable is being initialized with a distribution and both parameter and observed are false.
Loophole: For parameters with a constant prior, you do not usually specify a distribution. So these parameters are not covered by this case: you could have a lsl.Var object that should be a parameter, but that does not have a distribution. At the moment, nothing bad will happen as a result - but it is a little unsatisfying to me.
Check for consistent decomposition of the log_prob in the lsl.Model initialization. Raise an error if the decomposition is inconsistent.
The same constant-prior-loophole as above applies.
Loophole: If a Var with .parameter=False just so happens to have Var.log_prob = 0.0, the test will not discover an inconsistency in the log prob decomposition caused by this var.
I am not sure if this should be solved with code, but I'd like to discuss the issue.
The text was updated successfully, but these errors were encountered:
At the moment, Liesel lets you initialize a variable with a distribution without declaring it as a parameter or an observed variable. This can lead to inconsistencies in the model, such that it could be that:
i.e. the posterior is not equal to the likelihood plus the prior. This is, because the
log_lik
andlog_prior
attributes rely on thelsl.Var.parameter
andlsl.Var.observed
attributes to identify the variables to count for the respective values.Possible options would be:
parameter: bool
andobserved: bool
as init arguments tolsl.Var
.parameter
andobserved
are false.lsl.Var
object that should be a parameter, but that does not have a distribution. At the moment, nothing bad will happen as a result - but it is a little unsatisfying to me.log_prob
in thelsl.Model
initialization. Raise an error if the decomposition is inconsistent..parameter=False
just so happens to haveVar.log_prob = 0.0
, the test will not discover an inconsistency in the log prob decomposition caused by this var.I am not sure if this should be solved with code, but I'd like to discuss the issue.
The text was updated successfully, but these errors were encountered: