code: def sample_from_posterior(self, A: pd.DataFrame) -> None:
          
          self.sample_from_proposal(A)
          self.set_latent_state_sequence(A)
          self.update_log_prior(A)
          self.update_log_likelihood()
  
          candidate_log_joint_probability = self.log_prior + self.log_likelihood
  
          delta_log_joint_probability = (
              candidate_log_joint_probability - self.log_joint_probability
          )
  
          acceptance_probability = min(1, np.exp(delta_log_joint_probability))
          if acceptance_probability > np.random.rand():
              self.update_log_joint_probability()
          else:
              A[f"∂({self.source})/∂t"][self.target] = self.original_value
              self.set_latent_state_sequence(A)
              self.update_log_likelihood()
              self.update_log_prior(A)
              self.update_log_joint_probability()
docs: Run Bayesian inference - sample from the posterior distribution.