# An Agent-Specific Stochastic Model of Generalized Reaching Task Difficulty
## 2 Stochastic Index of Difficulty for a Generalized Reaching Task
When \(d_{k}(s)\) is normally distributed with zero mean value,  
Figure 1: Representation of a general spatial trajectory \(t\) and related constraints \(W(s)\). Authors’ elaboration according to [25]. i.e., \(d_{k}(s)\sim N(0,\sigma(d_{k}(s)))\), the sample standard deviation calculated on \(n\) trial trajectories observed is:  
\[\sigma(d_{k}(s))=\sqrt{\frac{1}{n-1}\cdot\sum_{k=1}^{n}\bigl{(}(x_{k}(s)-x(s))^{ 2}+(y_{k}(s)-y(s))^{2}\bigr{)}} \tag{5}\]  
Under this hypothesis, the range of variability of \(d_{k}(s)\) identified as the affordance limits of the agent-environment system, results as follows:  
\[W(s,\varphi)=2\cdot z\cdot\sigma(d_{k}(s)) \tag{6}\]  
where the \(z\) scores of the unit-normal curve depend on the \(\varphi\) value (\(z=1\) for \(\varphi=0.6827\); \(z=2\) for \(\varphi=0.9545\); \(z=2.066\) for \(\varphi=0.9600\); \(z=3\) for \(\varphi=0.9973\)). Under the assumptions made, and based on Equation (4), the Index of Difficulty \(ID_{agent}\bigl{(}\overline{t},\varphi\bigr{)}\) of an agent with observed average trajectory \(\overline{t}\) is defined for a given probability value \(\varphi\), as follows:  
\[ID_{agent}\bigl{(}\overline{t},\varphi\bigr{)}=\int_{\overline{t}}\frac{ds}{ W(s,\varphi)} \tag{7}\]  
Figure 3: Normal distribution of the local distance \(d_{k}(s)\) between the k-th and the average trajectories. Figure 2: Observed trajectories (\(t_{1}\),\(t_{2}\),..., \(t_{n}\)) of an agent and related average trajectory \(\overline{t}\). where, \(W(s,\varphi)\) is given by Equation (6) and \(ds\) is the infinitesimal length of the average spatial trajectory \(\overline{t}\). This cumulative index captures, in a probabilistic way, the agent-specific difficulty of the overall generalized reaching task, from initial to final position. The stochastic Index of Difficulty can also be calculated at the generic point of the curved path \(p(s)=p(x(s),y(s))\in\overline{t}\), as follows:  
\[ID_{agent}(x,\varphi)=\int_{x_{0}}^{x}\frac{1}{W(x^{\prime},\varphi)}\cdot \sqrt{1+\left(\frac{dy}{dx^{\prime}}\right)^{2}}\cdot dx^{\prime} \tag{8}\]  
where the infinitesimal length of the curved path has been rewritten as \(ds=\sqrt{1+\left(\frac{dy}{dx}\right)^{2}}dx\) and \(x_{0}\) is the \(x\) coordinate of \(\overline{t}\) for \(s=0\). This second formulation (Equation (8)) captures the agent-specific level of difficulty \"locally\", i.e., for a given portion of interest of the motor task. It should be noted that the hypothesis of normality of \(d_{k}(s)\) does not limit the general validity of the model; different probability density functions \(d_{k}(s)\) at each point of the average trajectory can be assumed. For example, when \(d_{k}(s)\) follows a uniform probability density function, it can be easily demonstrated that the affordance limits in the model can be identified by the variability range \(W(s,\varphi)=2\cdot\sqrt{3}\cdot\sigma(d_{k}(s))\cdot\varphi\). Due to its high number of degrees of freedom, the motor-control system of an agent has the possibility to exploit motor redundancies at the end-effector when performing repetitive movements, which can result in an increased variability observed during repeated trials of the same motor task [30]. A reduced level of redundancy in a generalized reaching task can be representative of a reduced affordance resulting from the interactions between the agent's dynamics and the constrained environment. In the proposed model, a reduced affordance is mainly captured by smaller limits \(W(s,\varphi)\), which are associated with a higher Index of Difficulty. Conversely, the agent-specific difficulty of a generalized reaching task (or a portion of it) is small when the combined agent-environment system shows increased affordance, by taking advantage of the motor redundancies.