Due to the availability of efficient and accurate sampling techniques for the underlying process \(S\)  at a given future time \(T\)  (we use the COS method [1]} enhanced with SC [2]}, and we call it COS-SC), the main issue is the sampling of the conditional random variable \(A(S)|S(T)\) .
This task is addressed in the same fashion as it is done in [3]}, where ANNs and stochastic collocation are applied for the efficient sampling from time-integral of stochastic bridgesBy stochastic bridge, we mean any stochastic process conditional to both its initial and final values., namely \(\int _{t_0}^T S(t) {\rm d}t\)  given the value of \(S(T)\) .
The underlying idea here is the same since the random variable \(A(S)\)  is conditional to \(S(T)\) .
Especially, in the previous sections we pointed out that the distribution of \(A(S)\)  has an unknown parametric form which depends on the set of Heston parameters \(\mathbf {p}\) . Similarly, we expect the distribution of \(A|S(T)=\hat{S}\)  to be parametric into the “augmented” set of parameters \(\mathbf {p}_{\hat{S}}:=\mathbf {p}\cup \lbrace \hat{S}\rbrace \) . Hence, there exists a mapping \(H\)  which links \(\mathbf {p}_{\hat{S}}\)  with the CVs, \(\mathbf {a}_{\hat{S}}\) , corresponding to the conditional distribution \(A(S)|S(T)=\hat{S}\) . We approximate \(H\)  by means of a suitable ANN \(\tilde{H}\) , getting the the following mapping scheme:
\(\begin{aligned}\mathbf {p}_{\hat{S}} \mapsto \mathbf {a}_{\hat{S}}:=H(\mathbf {p}_{\hat{S}})\approx \tilde{H}(\mathbf {p}_{\hat{S}}), \qquad \mathbf {p}_{\hat{S}}\in \Omega _{\mathbf {p}_{S}},\:\: \mathbf {a}_{\hat{S}}\in \Omega _{\mathbf {a}_{S}},\end{aligned}\) 
