<a href="https://colab.research.google.com/github/john-s-butler-dit/CaseStudy_PredatorPrey/blob/master/02_Campos_Butler_Bulthoff-Multisensory.ipynb" target="_parent"></a>

## Contributions of visual and proprioceptive information to travelled distance estimation during changing sensory congruencies
Jennifer L Campos, John S Butler, Heinrich H. Bülthoff
Experimental Brain Research

__Abstract__ Recent research has provided evidence that visual and body-based cues (vestibular, proprioceptive
and efference copy) are integrated using a weighted linear sum during walking and passive transport. However, little
is known about the specific weighting of visual information when combined with proprioceptive inputs alone, in
the absence of vestibular information about forward selfmotion. 

Therefore, in this study, participants walked in place on a stationary treadmill while dynamic visual information was updated in real time via a head-mounted display. The task required participants to travel a predefined distance and subsequently match this distance by adjusting an egocentric, in-depth target using a game controller. Travelled distance information was provided either through
visual cues alone, proprioceptive cues alone or both cues combined. In the combined cue condition, the relationship
between the two cues was manipulated by either changing the visual gain across trials (0.7×, 1.0×, 1.4×; Exp. 1) or
the proprioceptive gain across trials (0.7×, 1.0×, 1.4×; Exp. 2). 

Results demonstrated an overall higher weighting of proprioception over vision. These weights were scaled, however, as a function of which sensory input provided more stable information across trials. Specifically, when visual gain was constantly manipulated, proprioceptive weights were higher than when proprioceptive gain was constantly manipulated. These results therefore reveal interesting characteristics of cue-weighting within the context of unfolding spatio-temporal cue dynamics.
# Introduction
In this notebook we will simulate the results of the Leaky Integrator for the visual, proprioceptive and combined (visual and proprioceptive) condtions from the paper by Campos et al. 2014 [1].


```python
## Library
import numpy as np
import math 
import matplotlib.pyplot as plt
```

## Leaky Integrator
The presented distance travelled for the visual, proprioceptive and congruent combined conditions was each fitted by a leaky spatial integrator mode.
The model describes the change of presented distance travelled ($p$) with respect to the change of the adjusted target distance estimate ($x$)
\begin{equation}
\frac{d p}{dx}=-\alpha p+k
\end{equation}
for $0\leq x \leq 10m$, where $k$ and $\alpha$ are the sensory gain and the leak rate, respectively.
This model has the exact solution
\begin{equation}
p(x)=\big( \frac{k}{\alpha}\big)(1-exp(-\alpha x))
\end{equation}
In this simulation we set the parameters for the different conditions as:
* visual condition: $\alpha_{Vis}=0.05$ and $k_{Vis}=0.9$, 
* proprioceptive condition: for$\alpha_{Prop}=0.04$ and $k_{Prop}=1.2$,
* combined condition: $\alpha_{Comb}=0.02$ and $k_{Comb}=0.95$.



```python
alpha_vis=0.05
k_vis=0.9
alpha_prop=0.04
k_prop=1.2
alpha_comb=0.02
k_comb=0.95
```

## Discrete Domain
To numerically approximate the solution we discretise the continuous domain using a step size, $h=1$, 
which gives
\begin{equation}
x_i=0+i h,
\end{equation}
for $i=0,...10$.

The Figure below illustrate the discrete domain.


```python
h=1
x_end=10
x=np.arange(0,x_end+h/2,h)
fig = plt.figure(1,figsize=(5,4))
ax = fig.add_subplot(1,1,1)
ax.plot(x,0*x,'o:',color='k')
ax.set_xlabel('Distance Presented (m)')
plt.show()
```


```python
N=int(x_end/h) # Number of Steps
Vis_NS=np.zeros(N+1) # Numerical Solution P
Prop_NS=np.zeros(N+1) # Numerical Solution P
Comb_NS=np.zeros(N+1) # Numerical Solution P


Vis_AS=k_vis/alpha_vis*(1-np.exp(-alpha_vis*x))
Prop_AS=k_prop/alpha_prop*(1-np.exp(-alpha_prop*x))
Comb_AS=k_comb/alpha_comb*(1-np.exp(-alpha_comb*x))

# Initial Conditions
Vis_NS[0]=0
Prop_NS[0]=0
Comb_NS[0]=0
```

We numerically approximate the differential equation using Eulers method to give the difference equation
\begin{equation}
P_{i+1}=P_{i}+h \big(-\alpha P_{i}+k \big),
\end{equation}
where $h$ is the stepsize and where $P_i$ is the numerical approximation of $p(x)$ at distance $x_i$, for $i=0,...,10$



```python
for i in range (1,N+1):
    Vis_NS[i]=Vis_NS[i-1]+h*(-alpha_vis*Vis_NS[i-1]+k_vis)
    Prop_NS[i]=Prop_NS[i-1]+h*(-alpha_prop*Prop_NS[i-1]+k_prop)
    Comb_NS[i]=Comb_NS[i-1]+h*(-alpha_comb*Comb_NS[i-1]+k_comb)


```

## Results
The plot bellow shows the Numerical solution $P_i$ (left plot), the analytic solution $p(x)$ (middle plot) and the error $P(x_i)-P_i$ (right plot) as a function of presented distance $x$ for the visual condition (red), proprioceptive condition (green) and the combined condtion (blue).
The dashed black line in the left and middle plot represents perfect recall of the distance


```python
## Plotting Figure
fig = plt.figure(1,figsize=(12,4))

# --- left hand plot
ax = fig.add_subplot(1,3,1)
ax.plot(x,Vis_NS,'o:',color='red',label='Visual')
ax.plot(x,Prop_NS,'o:',color='green',label='Proprioception')
ax.plot(x,Comb_NS,'o:',color='blue',label='Combined')
ax.legend()
ax.plot(x,x,'--k',label='Perfect Recall')


ax.set_xlabel('Distance Presented (m)')
ax.set_ylabel('Response Distance (m)')
#ax.legend(loc='best')
ax.set_title('Numerical Solution')

# --- middle plot
ax = fig.add_subplot(1,3,2)
ax.plot(x,Vis_AS,'-',color='red',label='Visual')
ax.plot(x,Prop_AS,'-',color='green',label='Proprioception')
ax.plot(x,Comb_AS,'-',color='blue',label='Combined')

ax.plot(x,x,'--k',label='Perfect Recall')
ax.legend()


ax.set_xlabel('Distance Presented (m)')
ax.set_ylabel('Response Distance (m)')
ax.set_title('Analytic (exact) Solution')

# --- right hand plot
ax = fig.add_subplot(1,3,3)
ax.plot(x,Vis_AS-Vis_NS,'o:',color='red',label='VIS ERROR')
ax.plot(x,Prop_AS-Prop_NS,'o:',color='green',label='Proprioceptive ERROR')
ax.plot(x,Comb_AS-Comb_NS,'o:',color='blue',label='Combined ERROR')
ax.legend()


ax.set_title('Error')
ax.set_ylabel('Error(m)')
ax.set_xlabel('Distance Presented (m)')

# --- title, explanatory text and save
fig.suptitle('Leaky Solution', fontsize=20)
plt.tight_layout()
plt.subplots_adjust(top=0.85)
plt.show()
```

# References

[1] Campos, J. L., Butler, J. S., & Bülthoff, H. H. (2014). Contributions of visual and proprioceptive information to travelled distance estimation during changing sensory congruencies. Experimental brain research, 232(10), 3277-3289.

2963982df2e87b155b24410e663185c57febcefe
ipynb
Jupyter Notebook
02_Campos_Butler_Bulthoff-Multisensory.ipynb
john-s-butler-dit/CaseStudy_PredatorPrey
f7d3c2a4b27bd37db5690ea81130a47dcbb602af
MIT
02_Campos_Butler_Bulthoff-Multisensory.ipynb
john-s-butler-dit/CaseStudy_PredatorPrey
f7d3c2a4b27bd37db5690ea81130a47dcbb602af
MIT
02_Campos_Butler_Bulthoff-Multisensory.ipynb
john-s-butler-dit/CaseStudy_PredatorPrey
f7d3c2a4b27bd37db5690ea81130a47dcbb602af
MIT
Qwen/Qwen-72B
1. YES
2. YES