{'fraction_non_alphanumeric': 0.0340828191741813, 'fraction_numerical': 0.011865211200759373, 'mean_word_length': 4.568714899240172, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Monte Carlo gPC Methods for Diffusive Kinetic Flocking Models with Uncertainties

In this paper we introduce and discuss numerical schemes for the approximation of kinetic equations for flocking behavior with phase transitions that incorporate uncertain quantities. This class of schemes here considered make use of a Monte Carlo approach in the phase space coupled with a stochastic Galerkin expansion in the random space. The proposed methods naturally preserve the positivity of the statistical moments of the solution and are capable to achieve high accuracy in the random space. Several tests on a kinetic alignment model with self propulsion validate the proposed methods both in the homogeneous and inhomogeneous setting, shading light on the influence of uncertainties in phase transition phenomena driven by noise such as their smoothing and confidence band.


Introduction
Uncertainty quantification (UQ) for partial differential equations describing real world phenomena gained in recent years lot of momentum in various communities. Without intending to review the very huge literature on this topic we mention [3, 18, 22, 34, 40, 44-46, 48, 49] and the references therein. One of the main advantages of this approach relies in its capability to provide a sound mathematical framework to reproduce realistic experiments through the introduction of the stochastic quantities, reflecting our incomplete information on some features on the systems' modelling. This argument is especially true for the description of emergent social structures in interacting agents' systems in socio-economic and life sciences. Common examples are the emergence of consensus phenomena in opinion dynamics, flocking and milling patterns in swarming of animals or humans and the formation of stable wealth distributions in economic systems, see [39]. It is worth observing how for these models we can have at most statistical information on initial conditions and on the modeling parameters, which are in practice substituted by empirical social forces embedding a huge variability, see for example [5].
From a mathematical viewpoint, the kinetic equations we are interested in are nonlinear Vlasov-Fokker-Planck equations depending on random inputs taking into account uncertainties in the interaction terms or in the boundary conditions. These equations arise in the description of collective phenomena modeling the evolution of a distribution function f = f (θ, x, v, t), t ≥ 0, x ∈ R d x , v ∈ R d v , d x , d v ≥ 1, and θ ∈ I θ ⊆ R a random field, according to where B[·] is a non-local operator of the form being P ≥ 0 for all v, v * ∈ R d v and D = D(θ) ≥ 0 is an uncertain constant diffusion that depends on the introduced uncertainty. As a follow-up question to the progress of the analytical understanding of real phenomena, the existence of phase transitions driven by noise represents a deeply fascinating issue, see [17,19,23,25,28,29] and the references therein. The notion of phase transition has been fruitfully borrowed from thermodynamics to highlight the phase change of the system under specific stimuli. In particular, it is of interest the emergence of patterns in the collective dynamics for critical strengths of noise as in the classical Kuramoto model [8,14,37,42] or in collective behavior [6,28]. In the present paper we concentrate on a flocking model for interacting agents with self-propulsion and diffusion where the parameters are assumed to be stochastic. This model has been recently investigated in [1,6,7,10] in absence of uncertainties. The introduction of uncertain quantities points in the direction of a more realistic description of the underlying processes and helps us to compute possible deviations from the prescribed deterministic behavior.
Suitable numerical methods that preserve the positivity of the distribution function are developed and are based on the so-called of Monte Carlo generalized polynomial chaos (MCgPC) methods. The introduced class of schemes is based on a Monte Carlo approach in the phase space that is coupled with stochastic Galerkin decomposition in the random space [34,35,39,46]. This method has been recently proposed in [18] in the case of zero diffusion and it will be extended for models incorporating noise in the present setting. Furthermore, beside the natural positivity preservation, the resulting methods are spectrally accurate in the random space for sufficiently regular uncertainties. Furthermore, the adoption of a spectrally accurate methods in the random space is particularly efficient if compared with other nonintrusive approaches.
The rest of this paper has the following structure: in Section 2 we introduce in detail the class of kinetic flocking models of interest, the issue of phase transition will be treated with a particular focus on the relation between self-propulsion strength and noise intensity in the case they both depend on uncertain quantities. Section 3 focuses on the construction of Monte Carlo generalized polynomial chaos methods, a reduction in the computational complexity is here achieved through a Monte Carlo mean-field algorithm discussed in previous works. Finally, Section 4 is devoted to numerical test for the validation of the proposed schemes. Here continuous and Monte Carlo schemes will be compared to show the effectiveness of the MCgPC approach.

Phase Transitions in Kinetic Flocking Models with Uncertainties
Kinetic models for aggregation-diffusion dynamics encountered extensive investigation in recent years [6,7,11,13,15,16,24,26]. This class of models describes the aggregate behavior of large systems of self-propelled particles for which stable patterns emerge asymptotically. Nevertheless, at the present times, the study of the influence of ineradicable uncertainties in the modeling parameters is quite an unexplored area. We mention in this direction [3,18,30,31,44].
Let us consider first a kinetic flocking model for self-propelled particles with both stateindependent interactions and uncertain diffusion given by (1) with the following choice The model of interest is now characterized by a localised Vlasov-Fokker-Planck equation with random inputs for the dynamics of f = f (θ, x, v, t) and having the following form where α(θ) ≥ 0, D(θ) ≥ 0 are respectively self-propulsion strength and intensity of the diffusion operator, and where u f is the momentum of the system which is not conserved in time due to the presence of the self-propulsion term It seems worth stressing that, in the present setting, the role of the additive diffusion operator v f in (1), representing the impact of unpredictable events, is strongly different from that of the uncertainties introduced in the definition of the model parameters. The velocity diffusion term is, in fact, representative of all the possible modifications of the dynamics not modeled in a structural way, whereas θ ∈ I θ summarizes all source of modifications in the prescribed dynamics. We point the reader to [44] for a more focussed discussion in a related setting.
In the following we will treat separately the case space-homogeneous case and then we will provide some insights on the non-localised inhomogeneous setting.

Space Homogeneous Problem
In [6] the authors investigated the space homogeneous version of (3) in the deterministic setting. It has been proven that a phase transition between the so-called polarized and unpolarized motion takes place as the noise intensity D increases and for a specific range of the values of the self-propulsion strength α. At a difference with the cited results, the present formulation of the model embeds from the very beginning the presence of uncertain quantities.
Let us consider for simplicity the case of unitary mass, so that f is a probability density for all times t ≥ 0. First, we observe that (3) can be rewritten as a gradient flow. In fact, if we define with U(v) a interaction potential, given by U(v) = |v| 2 2 , and (v) a confining potential of the form the equation reads A free energy functional which dissipates along solution is defined for all θ ∈ I θ as follows Stationary solutions of the space-homogeneous problem satisfy the identity ∇ v ξ(θ, t) = 0 for all θ ∈ I θ and have the form being C > 0 a normalization factor. It is possible to prove the following result, see [6, Theorem 2.1]. This behavior is reminiscent of the one observed for the Vicsek model [6,23], where agents move with a constant speed and interact with their neighbors via a local alignment force and are subject to noise action. In particular, a critical noise intensity has been discovered whose value determines a phase transition between the ordered states and a chaotic state characterized by a null asymptotic average velocity of the system of agents. The critical noise value is theoretically demonstrated in [23] for the Vicsek model while for the present model there is a strong numerical evidence for its existence [6].

Space Inhomogeneous Case
In the non-localized inhomogeneous setting sharp results on analogous phase transitions are still non present in the literature due to the additional difficulties of the models. In the zero diffusion limit and without self-propulsion forces, small variations of the arguments in [15] prove that for a Cucker-Smale type interaction unconditional alignment, i.e., convergence to a profile travelling with the same mean velocity, emerges in the case γ ≤ 1/2 without conditions on the initial configuration of the system or on its dimensionality both at the kinetic and particle level [15,20]. In this case the asymptotic distribution is a Dirac delta in the velocity space, meaning that for large times the agents share the same velocity and that they form a group with frozen mutual distances. At the particle level, the case γ > 1/2 leads to a conditional flocking, i.e., alignment emerges for provable initial configurations of the system [20]. Initial density conditions to achieve asymptotic alignment for γ > 1/2 are still not proven, in general we may expect flocking for high mean-density distributions [16]. In the following we will present a numerical insight for the case of a VFP model with Cucker-Smale type interaction forces (5) in dimension d x = 1 and d v = 1, self-propulsion forces and uncertain diffusion coefficient. In particular, numerical results obtained with accurate numerical schemes highlight that a phase transition can occur also in this regime, shedding light on the deep interplay between alignment forces and noise strength in more general settings with not localized alignment [20,38].

Stochastic Galerkin Methods for Kinetic Equations
We introduce Stochastic Galerkin (SG) numerical methods with applications to the nonlinear Vlasov-Fokker-Planck (VFP) equation (1). We discuss the class of stochastic Galerkin (SG) methods and, in particular, we concentrate on the generalized Polynomial Chaos (gPC) decomposition [22,46,47,49]. These methods gained increased popularity in recent years since they guarantees spectral accuracy in the random space under suitable regularity conditions.
In our schemes, we exploit Monte Carlo methods for the approximation of the numerical solution of the (VFP) in the phase space taking advantage of particle based reformulation of the problem that converges in distribution to the solution for an increasing number of agents. The core idea then is to apply SG-gPC techniques for the efficient approximation of the random field in the resulting MC approximation. We highlight that the combination of the two approaches leads to a positive approximation of statistical moments of the solution even in the nonlinear case.
In the following we will derive a SG-gPC scheme for the continuous problem and we will consider specific formulation for the so-called Monte Carlo gPC methods (MCgPC), see [18].

Preliminaries on SG-gPC Expansion
In this section we derive a SG-gPC approximation for the uncertain nonlinear VFP equation (1) with nonlocal drift B[·] having the structure (2). Let ( , F, P ) be a probability space where as usual is the sample space, F is a σ -algebra and P a probability measure, and let us define the random variable with I θ ⊆ R and B I θ the Borel set, and with known probability density function (θ) : I θ → R + . Hence, we consider the linear space P M of polynomials of degree up to M, which is generated by a family of orthonormal polynomials being δ hk the Kronecker delta function. Assuming that (θ) has finite second order moment, we can approximate the distribution f ∈ L 2 ( , F, P ) in terms of the following chaos expansion (1) is then Thanks to the orthogonality of the polynomial basis of P M we obtain a coupled system of M + 1 purely deterministic PDEs for the evolution of each projectionf having defined the following matrices for h, k = 0, . . . , M The statistical quantities of interest may be defined in terms of the coefficients of the expansion. In particular, we have We introduce the vectorf = (f 0 , . . . ,f M ) and the (M , whose components are given by (7)(8)(9). We can reformulate (6) in more compact form as follows In the following, we indicate with f L 2 the standard L 2 norm of the vectorf(x, v, t) We can easily observe that, since the norm of thanks to the orthonormality of the basis We can prove the following stability result. For notation simplicity we consider the case Proof We multiply (6) byf h and integrate over R 2 to obtain After integration by parts the transport term vanishes and the right hand term reads and thanks to the symmetry of S and P we have Since and we obtain 1 and thanks to Gronwall's Lemma, we conclude.
We highlight how, as for classical spectral methods, the introduced SG decomposition leads to the loss of important physical properties of the solution like the positivity. A positivity preserving scheme is instead obtained if the matrix S + P = {S hk + P hk } M h,k=0 and the matrix D = {D hk } M h,k=0 are diagonal. This case corresponds to the situation where no uncertainties are present in self-propelling and diffusion terms and in case of interaction with a background distribution that does not encode any uncertainty. Under the introduced assumptions and with uncertain initial distribution of agents Therefore, we have to solve a set of M + 1 decoupled VFP equations. In this case we can apply structure preserving type schemes to ensure the positivity of the statistical moments, accurate description of the large time behavior of each projection and entropy dissipation, see [4,13,40,41,50].
To tackle efficiently the general fully nonlinear case in the following we will introduce a novel scheme that exploits the spectral convergence in the random space of SG-gCP methods and that naturally preserves the positivity of the numerical distribution.

Particle Based SG-gPC Formulation of Kinetic Equations
As for classical spectral methods, the solution of the coupled SG system (6) for f M looses its positivity and then a clear physical meaning. In order to overcome the difficulty recently the so-called Monte Carlo gPC (MCgPC) scheme has been proposed. These methods combine the advantages of a Monte Carlo approach for the approximation of f in the phase space and they conserve spectral accuracy in the random space. We refer to [18] for the study a wide range of mean-field equations describing the emergence of patterns and ordered behavior in large interacting systems in the zero diffusion limit.
The Monte Carlo (MC) method is a probabilistic particle method that describe the evolution of density functions by resorting to the computation of interactions in a finite set of randomly chosen particles of which it is known a priori the dynamics, see [21,39]. In MC methods the updated distribution function in the phase space is typically reconstructed from particles as post-processing. Several approaches are possible for the reconstruction step, which can estimated through a histogram, weighted integration rule methods or by a convolution of the empirical particle distribution with a suitable mollifier, see [33]. All the mentioned approximations preserve the positivity of the obtained numerical distribution function. Concerning the order of accuracy for MC methods, we have a convergence rate of where N is the number of considered samples, see [12]. Therefore, in order to set-up a MC scheme for the general equation (1) we need to find a system of stochastic differential equations which converge in distribution to the correct solution of the problem. This problem has been tackled in a more general setting in [9] and (1) can be derived from the following second order system of SDEs for (  (x i (θ, 0), v i (θ, 0)). In (10) we denoted by {W i } N i=1 a vector of N independent Wiener processes and independent with the random variable θ . Notice that the random variable θ plays the role of a parameter, thus for each sampling from the distribution (θ), we can apply the mean-field results developed in [9] to conclude that (3) is the mean field limit of (10).
It is worth to remark that in the case of vanishing self-propulsion, i.e., α(θ) ≡ 0, and for symmetric interactions, i.e., P (θ, x i , x j ) = P (θ, x j , x i ), the above system of SDEs preserves the initial mean velocity of the system in the limit N → +∞. Indeed we have to conclude due to a law of large numbers argument. In general, the mean velocity is not conserved due to the presence of the self-propulsion forces and appropriate methods must be developed to catch the correct transient regimes.
In the following we summarize the assumptions to ensure the mean-field convergence. Let us introduce the empirical measure associated to the particle system (10) weighted by the distribution of the uncertainty (θ), i.e., The transition to chaos for the particle system (10) follows from a small variation of [9, Theorem 1.1] under non restrictive assumptions on the a kernel K( The proof is based on the following argument: the N interacting process (x i (θ, t), v i (θ, t)) N i=1 behaves in the limit N → +∞ like the process defined by the set ( where f is the probability law of (θ,x i (θ, t),v i (θ, t)) and {W i } N i=1 are the Wiener processes characterizing (10). The processes are identically distributed and independent from the random variable θ, and by the Itô formula their law f evolves according a VFP equation of type (1). We summarize this in the following result representing a direct extension of Theorem 1.1 in [9] that holds for all θ ∈ I θ .  (θ, 0), v i (θ, 0)) for all i = 1, . . . , N be N independent variables for all θ ∈ I θ . We assume that the drift and the antisymmetric kernel satisfy that there exist constants A, L, p > 0 such that for all x, y ∈ R d x , v, w ∈ R d v . If the particle system (10) and the processes (11) have global solutions on the finite time interval [0, T ] with initial data (x i (θ, 0), v i (θ, 0)) such that If there exists p > p such that then for all 0 < < 1 there exists a constant C > 0 such that We have denoted with E θ,W [·] the expectation taken with respect to the distribution of the Wiener processes and the random variable θ. We highlight how the provided bounds hold for all θ ∈ I θ and in particular we take expectation with respect to the introduced stochastic parameter. It is easily verified that for the introduced self-propulsion force and the kernels of interest the assumptions are met. Therefore the mentioned theorem gives the following quantitative result on the convergence of the empirical measure f (N) to the distribution f : where ε(N) → 0 for N → +∞ with a rate ε(N) defined in (12)-(13) depending on the assumptions on the solutions in Theorem 3 and the law of large numbers to deal with the last term. These arguments are standard in interacting particle systems and analogous to [9] and the references therein.
In the next section we derive a SG-gPC decomposition of (10) so that we will preserve the exponential convergence in the random space with respect to all the uncertain quantities.

Stochastic Galerkin Scheme for the Particle System
In the following we consider the gPC decomposition of the microscopic dynamics (10). Space and velocity variables of the ith agent, for all i = 1, . . . , N, are approximated by being as before { k (θ)} M k=0 an orthonormal basis of L 2 ( ). Next we give explicit representation of the SG-gPC expansion at the particle level. To obtain the SG-gPC decomposition for the particle system we rewrite (10) and again thanks to the orthogonality of the polynomial basis we obtain for all i = 1, . . . , N the following coupled system of SDEs describing the evolution of each component of the original variables in the phase space where It is worth to remark that in the case of vanishing self-propulsion s hk (v M i ) = 0 for all h, k = 0, . . . , M and for symmetric interactions p ij hk = p ji hk we recover the conservation of the mean velocity of the system also in the SG decomposition.
The convergence of the SG-gPC expansion (6) for sufficiently regular function follows from standard results in polynomial approximation theory, we recall for example [27]. In general, thanks to the property of the introduced polynomial basis we have Theorem 4 We consider θ ∈ I θ with distribution (θ) and the basis { h } M h=0 of orthonormal polynomial basis in L 2 ( ). Then, for any g(θ, t) ∈ L 2 ( ) In the present setting, thanks to Theorem 4 it is reasonable to expect the convergence of the empirical measure to the empirical measure f (N) as M → ∞ for all t ≥ 0 and for (x M i , v M i ) solution to (15). Hence, from the mean-field convergence showed in Theorem 3 we would guarantee that f (N,M) converges to f (θ, x, v, t) solution of the initial VFP problem by taking first the limit of the Galerkin modes M → ∞ and then the limit of large number of particles N → ∞. We can prove the following result following the footprint of (14) and Theorem 4 applied to x i (θ, t) and v i (θ, t).

Theorem 5 Let us define the following empirical measure
Proof To prove the convergence in P (P ( ×R d x ×R d v )) we consider a sufficiently regular test function in all variables (θ, x, v), that we can assume of the form ϕ 1 (θ)ϕ 2 (x, v) without loss of generality, and we compute providing the convergence result for M → +∞.
In the last section we will give numerical evidence of this result.

Monte Carlo gPC Scheme
We now approximate the limiting stochastic kinetic equation taking advantage of the particle reformulation of the problem. In fact, since the solution of the system of SDEs (10) converges in distribution to the solution of the original problem (1) for N → +∞, we can approximate the original dynamics by means of a Monte Carlo (MC) method in the phase space. The main drawback of this approach lies in the computational cost O(M 2 N 2 ), since at each time step and for each gPC projection each agent modifies its velocity in a genuine nonlinear way. A significant reduction in terms of computational cost can be achieved through a mean field MC evaluation of the interaction dynamics as originally proposed in [2], see [18] for the UQ framework. Thanks to this approach we have an efficient algorithm for transport and interaction in the phase space and we can reconstruct the expected solution from the particle system from positions and velocities at the microscopic level, which is considered in the SG-gPC setting as in Section 3.2.1. This approach has been recently analysed in connection to other problems in [36].
We sketch in Fig. 1 the two approaches for the approximation of statistical quantities of the nonlinear nonlocal stochastic VFP problems of interest. In the left branch we find the standard SG approach where first we consider the gPC approximation of the original problem, which generates a coupled system of PDEs that can be solved through deterministic methods to obtain the evolution of expected quantities. On the right branch we describe the introduced MCgPC procedure, based on a particle reformulation of the problem which converges in distribution in the phase space to the solution of the problem. The advantage of considering a gPC scheme for the microscopic system lies in the preservation of the typical spectral convergence in the random space of the method. We highlight how thanks to the adoption of the computational strategy in Algorithm 1 the overall cost becomes O(M 2 SN), S N . For the reconstruction of expected quantities, in the present manuscript we consider the histogram of position and velocity of the set of particles in the phase space, we point the reader to [33] for possible alternatives. Thanks to the MC approach the resulting method preserves the positivity of the expected distribution function.
whose leading error is given by I 1 since S N and, for N 0, we may observe that the accuracy with which we approximate f (N,M) with f (S,M) is O 1 S − 1 N thanks to a central limit theorem-type argument.

Numerical Tests
In this section we present several numerical examples based on (3) both in the homogeneous and inhomogeneous cases. We test the effectiveness of the MC-gPC scheme through several tests based on VFP equations. In all test the integration of the system of stochastic differential equations (10) is performed through a standard Euler-Maruyama method whereas the solution of the system of PDEs derived from the SG procedure is solved through a standard central scheme coupled with a fourth order Runge-Kutta integration. In the whole section we will consider a uniform noise, therefore Gauss-Legendre polynomial basis are chosen in the gPC setting. Numerical investigations on the influence of uncertainties in phase transition phenomena are presented through the section. Finally, we explore the non localized inhomogeneous model with Cucker-Smale type interactions.

Test 1: Space Homogeneous Case
In this first test we consider the space homogeneous problem in 1D with uncertain diffusion parameter of the form where θ ∼ U ([−1, 1]) and λ ≤ 1 is such that D(θ) ≥ 0 for allD ≥ 0. We consider a constant self propelling strength α(θ) = α ≥ 0. The evolution of the density function f (θ, v, t), v ∈ R is ruled by the following PDE whose SG-gPC approximation is given for all h = 0, . . . , M by being At the particle level we obtain from (15) the following coupled system of SDEs for the evolution of the particles' velocities and {W i } N i=1 defines a set of N independent Wiener processes. Furthermore, we indicated withû h the hth projection of the average velocity of the system.
The long time solution is given by (4) as discussed in Section 2.1. We consider as deterministic initial condition the Gaussian distribution At the particle level the initial velocities are a sample of N 0 velocities from the distribution f 0 (v). In Fig. 2 we compare the numerical expected distribution of the SG-gPC system (17) and the reconstructed expected density of the MCgPC scheme at time T = 50 for two uncertain diffusion coefficients (16) withD = 0.2,D = 0.8 and λ = 0.1 in both cases. It is easily observed how for an increasing number of particles the statistical quantities are well approximated by the scheme.
In Fig. 3 we study the convergence of the temperature of the system We can easily observe the regions of maximal sensitivity with respect to the presence of uncertainties. In particular, for high diffusion values the variability of the expected average velocity vanishes and we may argue that the phase transition predicted in [6] is actually a quite stable pattern in the space homogeneous regime. Nevertheless, the averaging of uncertain quantities acts as a smoothing factor of the phase transition as we can clearly observe in Fig. 4b and d. For a vanishing influence of θ ∈ I θ given by λ → 0 in (16) the transition becomes sharper coherently with the deterministic case, see Fig. 4d. Summarizing the main effect of the uncertainties is the smoothing of the transition point making it less sharper and abrupt than in the deterministic cases.

Test 2. Space Inhomogeneous Case
In this section we focus on inhomogeneous models. First we consider the localised case for which a phase transition is expected to happen similarly to the homogeneous case, see [6], even if this has not yet been proved. To explore other possible alternatives we will also consider the case of Cucker-Smale type interactions for which no analogous theoretical results regarding phase transitions currently exist. In all the tests of the present section we consider a sample of N = 10 5 particles for the MCgPC scheme.

Test 2A. Localized Interaction Case
We consider a space dependent interaction function of Dirac delta form, i.e., P (x, x * ) = δ(x − x * ). With this choice agents interact only if they share the same position. In this case, the MCgPC scheme translates in a second order system of SDEs of the form where s hk has the same definition of the space homogeneous case. As before we consider an uncertain diffusion parameter D(θ) and a constant self-propulsion α = 1.
We introduce a discretization of the phase space Let us consider the evolution of the gPC system of PDEs derived in (6) with localized interactions in (8). At the numerical level we perform a second order Strang splitting approach. The transport step is integrated through a third order Runge-Kutta scheme with a fifth order WENO reconstruction [43]. In the following we compare the behavior of the continuous approximation with the one obtained through the MCgPC scheme where, to localize the interaction, we considered as a smoothing factor the indicator function of the numerical cell [x i , x i+1 ].
In Figs. 5 and 6 we compare the evolution of the expected density over the time interval [0, 5] for the inhomogeneous kinetic equation (1) with local interactions. In particular, we present the expected density obtained through numerical integration of the SG-gPC system of PDEs with the one approximated through the MCgPC scheme with fast evaluation of the interaction term through a mean-field MC approach described in Algorithm 1 and interaction subset of S = 10 particles. The uncertain diffusion has the form (16) withD = 0.2, D = 0.8 and λ = 0.1. Periodic boundary conditions have been considered. The results are in agreement with the space homogeneous case since the interaction are localised. It is easily observed how a phase transition occurs switching from an ordered state to a chaotic isotropic state for increasing values of the diffusion. In Fig. 7 the average in position distributions in velocity are compared between the MCgPC and gPC. These results corroborate

Test 2B. Cucker-Smale Type Interactions
In this section we consider the evolution of statistical quantities obtained from (1) with space dependent interaction kernel of the Cucker-Smale (CS) type P (x, x * ) = 1 (1 + |x − x * | 2 ) γ , γ = 0.1. This choice of interaction has been introduced in [20] and received a lot of attention in the recent literature on kinetic models for emergent behavior. Without intending to review the huge related literature we mention [15,16,32] for an introduction on the topic. Recent efforts on CS dynamics in the UQ setting are [3,34]. As we already mentioned, at the Fig. 9 Test 2B. The same as Fig. 8 but withD = 0.8 present times there are no analytical results regarding possible phase transitions for this highly nonlinear kernel in the VFP setting. The determination of sharp estimates on the possible phase transitions is an open problem which goes beyond the purpose of the present manuscript. Hence, to complete the overview on the introduced methods we give a numerical insight on the features of the resulting dynamics. In order to observe the action of uncertainty in the system we consider a stochastic diffusion parameter D(θ) =D + λDθ, with λ = 10 −1 and θ ∼ U ([−1, 1]) in the casesD = 0.2 andD = 0.8. In Figs. 8 and 9 we report the expected dynamics of the VFP model (1) with CS interactions and stochastic diffusion obtained through the MCgPC scheme. Periodic boundary conditions have been taken into account. In particular, a sample of N = 10 5 particles is considered for the reconstruction of the expected density in the interval [−2, 2] × [ −3, 3] with N x = 20, N v = 40 gridpoints. In the random space we considered M = 3 modes for the gPC expansion. We can observe how the expected density moves from an ordered state for small values of diffusion to a chaotic isotropic for sufficiently big values of diffusion. We postpone to later works a more detailed insight on these phenomena for general interaction kernels.

Conclusion
The introduction of uncertainties in swarming dynamics is of paramount importance for the large-scale description of realistic phenomena. We concentrated in this manuscript on the case of Vlasov-Fokker-Planck equations for emerging collective behavior with phase transitions depending on the strength of self-propelling and noise terms. We extended to these models the construction of nonnegative gPC schemes for kinetic-type equations. The proposed approach takes advantage of a Monte Carlo approximation of the kinetic equation in phase space which is coupled with a stochastic Galerkin gPC expansion. Several numerical tests were proposed both in the homogeneous and inhomogeneous settings, proving the effectiveness of the approach and shedding light on the action of uncertainties in terms of the stability of the phase transitions, We generically observe that they lead to a smoothing of the sharp transition values. Several extensions of the present work are possible from both the analytical and numerical viewpoints and in connection with more general kernels in the collision/interaction dynamics.