Skip to content

Commit 979f55c

Browse files
committed
Set the inside value of nonfixed samples to the prior
1 parent 89d9ee5 commit 979f55c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tsdate/core.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,14 @@ def inside_pass(self, *, normalize=True, cache_inside=False, progress=None):
647647
inside = self.priors.clone_with_new_data( # store inside matrix values
648648
grid_data=np.nan, fixed_data=self.lik.identity_constant
649649
)
650+
# It is possible that a simple node is non-fixed, in which case we want to
651+
# provide an inside array that reflects the prior distribution
652+
nonfixed_samples = np.intersect1d(
653+
self.priors.nonfixed_node_ids(), self.ts.samples()
654+
)
655+
for u in nonfixed_samples:
656+
inside[u][:] = self.priors[u]
657+
650658
if cache_inside:
651659
g_i = np.full(
652660
(self.ts.num_edges, self.lik.grid_size), self.lik.identity_constant

0 commit comments

Comments
 (0)