bsfit.nodes.models.utils.get_percept_likelihood

bsfit.nodes.models.utils.get_percept_likelihood(percept_space: numpy.ndarray, stim_mean: numpy.ndarray, stim_mean_space: numpy.ndarray, meas_density: numpy.ndarray, percept: numpy.ndarray, max_nb_percept: int)[source]

calculate percept likelihoods.

Parameters
  • percept_space (np.ndarray) – the percept space (1:1:360)

  • stim_mean (np.ndarray) – stimulus feature

  • stim_mean_space (_type_) – the space of the stimulus feature (1:1:360)

  • meas_density (np.ndarray) – measurement probability density

  • percept (np.ndarray) – percept

  • max_nb_percept (int) – the maximum number of percepts

Returns

percepts (np.ndarray): associated percept likelihood

Return type

(np.ndarray)

Notes

It is the P(m_i|s_i) of the m_i that produced that data map m_i and percept(s) p_i in P(p|m_i) P(p|m_i) is important because e.g., when a m_i produces a bimodal posterior in response to a stimulus (e.g., {flat likelihood, bimodal prior}), the two modes are equally likely P(p_1|m_i) = P(p_2|mi) = 0.5 and P(p_1|s_i) = P(p_1|s_i) = P(p_1|m_i)*P(m_i|s_i) = 0.5*P(m_i|s_i). Similarly, P(p_2|s_i) = P(p_2|m_i)*P(m_i|s_i) = 0.5*P(m_i|s_i). The P(p|m_i) of each percept observed for a m_i is 1/len(p). percepts only depend on m_i which determines likelihood. The displayed stimulus determines percept probability. Percepts per m_i (rows) are the same across stimulus feature means (cols). m_i rows are repeated in the matrix when a m_i produces many percepts. e.g., the matrices for a max number of percept per m_i=2