Models of Bimodal Duration Estimation
Model Coding:
Created: June 18, 2025 6:09 PM
Tags: article note
1- Unimodal
1.1 Measurement

# unimodal measurements
def unimodalMeasurements(sigma, S):
# P(x|s) # generate measurements from a normal distribution
m = np.random.normal(S, sigma**2, 10000) # true duration is S seconds
return m
1.2 Likelihood
def gaussianPDF(m,s,sigma):
return (1/(np.sqrt(2*np.pi)*sigma))*np.exp(-((x-s)**2)/(2*(sigma**2)))
# likelihood function
def likelihood(S, sigma):
# P(m|s) # likelihood of measurements given the true duration
m=np.linspace(S - 4*sigma, S + 4*sigma, 500)
p_x=gaussianPDF(m,S,sigma)
return x, p_x
1.2.1 Plot Likelihoods analytically
def plotLikelihood(S,sigma):
x, p_x = likelihood(S, sigma)
plt.plot(x, p_x, label='Likelihood Function')
plt.xlabel('Measurement $m$')
plt.ylabel('Probability Density')
plt.title('Analytical Likelihood $P(m|s)$')
plt.legend()
def plotMeasurements(sigma, S):
m = unimodalMeasurements(sigma, S)
plt.hist(m, bins=50, density=True, alpha=0.5, label='Measurements Histogram')
plt.xlabel('Measurement $m$')
plt.ylabel('Density')
plt.title('Unimodal Measurements Histogram')
plt.legend()


2 Bimodal
graph TD
A(C) --> B1(C=1)
A --> b2(C=2)
B1-->b11(S)
b11-->b111(m_a)
b11-->b112(m_v)
b2-->b21(S_a)
b2-->b22(S_v)
b21-->b211(m_a)
b22-->b212(m_v)
2.1 Fusion (C=1)
2.1.1 Fusion of one interval
def fusionAV(sigmaAV_A,sigmaAV_V, S_a, visualConflict):
m_a=unimodalMeasurements(sigmaAV_A, S_a)
S_v=S_a+visualConflict
m_v = unimodalMeasurements(sigmaAV_V,S_v ) # visual measurement
# compute the precisons inverse of variances
J_AV_A= sigmaAV_A**-2 # auditory precision
J_AV_V=sigmaAV_V**-2 # visual precision
# compute the fused estimate using reliability weighted averaging
hat_S_AV= (J_AV_A*m_a+J_AV_V*m_v)/(J_AV_V+J_AV_A)
mu_Shat = w_a * S_a + w_v * S_v # fused mean
sigma_S_AV_hat = np.sqrt(1 / (J_a + J_v)) # fused standard deviation
return hat_S_AV , sigma_S_AV_hat # belief about fused stimulus value

2.1.2 Fusion of 2-IFC Duration Difference
is the duration difference between t (test interval) and s (standard interval)
= measurement for auditory test duration.
= measurement for auditory standard duration.
= conflict duration incorporated to the visual standard stimulus.
The difference between two interval within single trial:
Expected value of duration difference
Test Interval:
Standard interval:
Duration difference:
substituting:
Notice that sum of weights equal to 1 as we assume fusion.
Final predict:
is predicted bias:
- if c>0 standard visual is longer), the standard is perceived as longer, so test needs to be even longer to be matched.
- The PSE shifts by
Decision Rule: