{'fraction_non_alphanumeric': 0.03819180979972868, 'fraction_numerical': 0.013933917362212871, 'mean_word_length': 5.117018284106892, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
On Kalman-Bucy filters, linear quadratic control and active inference

Linear Quadratic Gaussian (LQG) control is a framework first introduced in control theory that provides an optimal solution to linear problems of regulation in the presence of uncertainty. This framework combines Kalman-Bucy filters for the estimation of hidden states with Linear Quadratic Regulators for the control of their dynamics. Nowadays, LQG is also a common paradigm in neuroscience, where it is used to characterise different approaches to sensorimotor control based on state estimators, forward and inverse models. According to this paradigm, perception can be seen as a process of Bayesian inference and action as a process of optimal control. Recently, active inference has been introduced as a process theory derived from a variational approximation of Bayesian inference problems that describes, among others, perception and action in terms of (variational and expected) free energy minimisation. Active inference relies on a mathematical formalism similar to LQG, but offers a rather different perspective on problems of sensorimotor control in biological systems based on a process of biased perception. In this note we compare the mathematical treatments of these two frameworks for linear systems, focusing on their respective assumptions and highlighting their commonalities and technical differences.


Introduction
The Linear Quadratic Regulator (LQR) is is a method originally developed in the field of control theory [57,55,3,85] with the goal of describing a solution to linear control problems using "full-state" feedback methods, i.e., methods relying on a state of the system to regulate (or plant) that is fully available. In more realistic applications however, it is common to assume that the state of a plant and its ensuing dynamics cannot be fully observed, i.e., they are only partially observable, or hidden. With incomplete information, an observer (or estimator) is usually introduced to first infer the hidden dynamics of a system, combining this inference on the (hidden) state of a plant with LQR methods to build an optimal feedback law [5,3,85]. In the case of linear continuous time problems, the optimal observer has the form of a Kalman-Bucy filter [50,4,85]. The combination of Kalman-Bucy filters and LQR often goes by the name of Linear Quadratic Gaussian (LQG) controllers [105,5,3,85]. Despite some of its well-known limitations (e.g., its robustness issues [25]), LQG constitutes nonetheless a standard approach for a large class of linear problems in stochastic optimal control [5], due to its analytical tractability and guaranteed optimality under a given set of assumptions. In the last few decades, LQG and some of its extensions have also become a standard paradigm outside of the field of control theory, in particular for models of sensorimotor control in neuroscience [68,95,92,31]. This reflects recent developments in computational models of perception and behaviour, nowadays mostly described in terms of state estimation, or inference [64,80,66,63,35], and optimal control [62,103,95,91,31] respectively.
In the last few years, active inference has also been introduced in computational and cognitive neuroscience as a theory to describe brain functioning in terms of (approximate Bayesian) inference and control [38,35,40,39,78]. Similarly to LQG, active inference has also been instrumental in defining models of perceptual and motor processes, from physiological accounts of motor control [1], all the way to computational descriptions of optimal behaviour claimed to be contrasting LQG [36]. The rapidly evolving nature of this theory has so far encouraged different authors to cover and summarise some of its different technical aspects [19,21,17,81,47,23]. At the moment, however, the relationship between this framework and popular LQG-based models in neuroscience remains still unclear, especially considering how the two share a common mathematical background based on methods coming from (approximate) Bayesian inference and stochastic optimal control, but generate rather different predictions. The goal of this note is thus to produce a comparison of the mathematical treatments introduced by active inference and LQG. The discussion will be based on 1) continuous time linear problems, using 2) standard formulations of both frameworks (thus not explicitly addressing more advanced proposals, such as the "optimal feedback control" extension of LQG [95,92], leaving this for future work), to focus on 3) their possible implications for the neural and the cognitive sciences.

Linear Quadratic Gaussian control for linear multivariate continuous time systems
In this section we introduce the mathematical underpinnings of LQG control, starting from a general formulation of the Kalman-Bucy filter and LQR for multivariate systems in continuous time, and then combining their results under the separation principle [105] to form LQG controllers. A full derivation, including mathematical proofs and other technical details not relevant to our comparison can be found in standard treatments of Kalman filtering [50,22] and LQR/LQG [3,85].

Kalman-Bucy filter or Linear Quadratic Estimator (LQE)
The Kalman-Bucy filter, also known as Linear Quadratic Estimator (LQE), is an algorithm for the estimation of hidden or latent variables evolving over time, i.e., hidden states with some (linear) dynamics [56,84,50,22]. Its popularity is mainly due to the fact that • it's the optimal 1 filter for estimation/inference of hidden states in linear systems, • it provides a recursive algorithm well suited for computer simulations and online applications with new data added over time, and • it makes no assumptions on the stationarity of the hidden dynamics a system, particularly relevant for real-world applications and especially control problems.
In this treatment we will focus on the continuous formulation of this algorithm, the Kalman-Bucy filter [58], as opposed to its discrete formulation, often simply going by the name of Kalman filter [56]. To introduce the Kalman-Bucy filter, we initially define a (linear) continuous dynamical systems in state-space form, representing the simplest plant whose hidden state the filter ought to estimate: Here the bold characters indicate vectors. The first equation describes linear dynamics for a vector of hidden states x ∈ R n . In the second equation, y ∈ R m is a vector of noisy measurements, or observations, of hidden states x. Vectors w ∈ R r , z ∈ R s correspond to Wiener processes for state and observation equations respectively, with dw = N (0, Σ w ), dz = N (0, Σ z ) thus defined as zero-mean white Gaussian random variables with covariance matrices Σ w , Σ z [50,22]. Matrices are represented using capital letters, with C ∈ R m×n as the observation matrix mapping dynamics x to observations y and A ∈ R n×n as the state transition matrix characterising the time-dependent evolution of x. The Kalman-Bucy filter is known in the literature to be the optimal estimator for linear systems with quadratic cost functions and Gaussian white random variables [56,50,22,6]. Under these assumptions, it is also a minimum variance estimator [50,22], i.e., it minimises an objective function represented by the mean square error (MSE), or variance of the error, given by: wherex is a vector of the estimates of states x. Through the Kalman-Bucy algorithm, one can determine estimates x via [50,85,22]:ẋ =Ax + K(y − Cx) The vectorx is thus updated using the sum of the current best estimate multiplied by the known transition matrix, Ax, and prediction errors (or innovations), y − Cx. These prediction errors are multiplied by the Kalman gain matrix, K ∈ R n×m , expressed in the second equation, and representing the optimal trade-off between previous estimates and information gathered from new observations. To calculate the Kalman gain matrix one then needs to estimate P ∈ R n×n , the a-posteriori error covariance matrix, expressing the accuracy of the state estimate in the first equation. The trace of P (i.e., the sum of the components on the main diagonal) gives the sum of the independent components of the covariance matrix equivalent to the MSE in equation (2), thus describing the accuracy of the state estimation process too. Kalman(-Bucy) filters can also be described in terms of Bayesian inference, withx and P representing mean and covariance matrix of an estimated (multivariate) Gaussian distribution of hidden states x [50,71,22].

Linear Quadratic Regulator (LQR)
Linear Quadratic Regulator (LQR) is defined for deterministic linear systems with quadratic cost functions. Under these assumptions, the optimal control law is equivalent to a negative (proportional) feedback mechanism 2 [57,55,3]. The noiseless plant to regulate is represented by a linear differential equation: with x ∈ R n as a vector of measured variables to be controlled. In this case we assume that the state of the plant is directly observable (no measurement noise, dz in the LQE formulation) so while the differential form dx is not strictly necessary (i.e., we could replace dx withẋ and drop the dt notation), it is maintained for consistency with the Kalman-Bucy filter definition provided previously. A ∈ R n×n is the state transition matrix, as in the case of the Kalman-Bucy filter, while B ∈ R n×p is the control matrix mapping actions a ∈ R p to outputs x. Actions are often represented by u in the control theory literature, however here we highlight a difference that will become important later: in the present note, u ∈ R l describes inputs from a more general state-space perspective, i.e., all the variables that affect the (hidden) states of a system but are not states themselves, such that In this formulation, a is used to represent only a part of all possible inputs, i.e., the subset of inputs produced by a regulator that have an effect on the hidden state of a system (in the sense on Kalman's controllability of a plant [55,85]), such as the motor actions of an agent that affect its environment. Variables d ∈ R q include, on the other hand, disturbances that influence a system but cannot be governed by a controller. Often, the definitions of u and a are often used interchangeably, assuming either that • all the modeled inputs are controllable, i.e., there are no other unknown external forces affecting the state of a system, only small and especially brief perturbations that can be considered as part of noise on dynamics (dw) [68,49], or that • perturbations are control-dependent, i.e., they are only due to motor actions and can thus not account for other exogenous sources [95,92].
In LQR, the goal is to stabilise (control, compensate or regulate) variables x around target values defined by v ∈ R p3 , controlling x through actions a. Such actions are determined via the optimisation of a function that accumulates costs over time, called cost-to-go or value functional: which represents the infinite horizon simplification of the problem, i.e., the upper limit of the integral is infinity. The instantaneous version, simply called cost function or cost rate, is defined for LQR as: with Q ∈ R n×n ≥ 0 and R ∈ R p×p > 0 as arbitrary matrices representing the relative balance between the minimisation of the distance from the target and costs for control respectively. In LQR, the optimal action vector a is computed using [3,85,93]: The first equation implements a negative feedback mechanism on x using actions a. In the second equation, L is the feedback gain matrix, determined using the matrix V , which is the Hessian of the cost-to-go functional defined in equation (6) [94].

Linear Quadratic Gaussian (LQG) control
One of the limitations of standard LQR controllers lies in the fact that they do not explicitly deal with state/observation uncertainty (or noise), i.e., the original formulation is for deterministic systems only [55].
On the other hand, in real-world engineering applications as well as in biological systems, it is more common to think of systems with limited access to information from the environment and actions a thus applied to a set of hidden states x when only noisy measurements y are available. In the control theory literature, Linear Quadratic Gaussian (LQG) control [5,8,3,85] is thus introduced as a combination of estimation and control for linear systems, building on the previously defined Kalman-Bucy filter and LQR. Under a particular set of assumptions, LQG controllers can then be seen as "modular", with estimation and control processes independently designed to form an optimal solution following the separation principle of control theory [54,105,46]. The idea behind the separation theorem is very closely related to the certainty equivalence described in econometrics and decision making [83,90], although some works, including [102,14,85], highlight their differences especially in the context of "dual effects" (see Discussion) and risk-sensitive control. In information theory, Shannon [82] also introduced a different notion of a separation principle, to explain coding via two (separate) phases of source compression and channel coding [45]. The connections between Shannon's work and the separation principle in control theory have become more clear in recent years, thanks to a growing literature showing how Shannon's definition captures and potentially generalises the results from control theory, see for instance [89,88,30]. Here however, the focus will be on the principle traditionally described in control theory for LQG in continuous systems [54,105], under the following standard assumptions [105,5,14,3,85]: 1. linear process dynamics and observation laws describing the environment and its latent variables, 2. Gaussian white additive (cf. [92]) noise in both process and measurement equations, 3. known covariance matrices for both process and measurement noise, 4. quadratic cost function used to measure the performance of a system, and The last condition is particularly relevant for a comparison with active inference and is due to the assumptions behind the Kalman-Bucy filter, defined as an optimal estimator in an unbiased sense only for known inputs [32], outputs (i.e., measurements) and parameters. To provide a more formal treatment of the separation principle, we then define a general linear system to be regulated in the presence of noise or uncertainty: where all the variables and parameters follow the notation previously defined for Kalman-Bucy filters and LQR. In this case, the cost rate is modified to deal with a stochastic system with white additive noise on both dynamics and observations. To do so, the standard formulation of LQR is extended, including stochastic variables so to minimise the expected cost-to-go [85,93]: Importantly, one can show that under the assumptions introduced above where we replaced states x with their estimatesx, thus implying that the optimal control can be computed using only the state (point) estimates, i.e., meansx. Minimising the expected value of the cost-to-go is thus equivalent to minimising the cost-to-go for the expected state.
Optimal estimation and control are then achieved by sequentially combining two separate parts, a Kalman-Bucy filter and a LQR, to produce a regulator optimal in a minimum-variance, unbiased sense [3,85]. One thus obtain the following scheme:ẋ where the Kalman-Bucy filter provides optimal (unbiased) state-estimatesx of observations y that are conditionally dependent only on the vector of motor actions a that contributed to the generation of the current observations y (i.e., at the time of the estimation), thanks to a Markov assumption due to the presence of white noise [22]. The LQR then uses these point estimates to implement an optimal controller that essentially treats the problem as a deterministic one by replacing the state of a plant with its best estimate, the mean, see also Fig. 1. The ability to analytically evaluate the expected cost rate using only expectationsx, see equation (11), is thus at the core of LQG architectures. In this way, estimation and control processes interact via the sharing of some information in the form of estimatesx to the controller and a copy of actions a to the estimator, but are otherwise seen as fundamentally separable modules to be optimised independently.

Active inference for linear multivariate continuous time systems
Active inference is a process theory describing brain functioning and behaviour in living systems using ideas from Bayesian inference and stochastic optimal control [38,35,40,21,39]. In this section we begin to establish its relations to the LQG architecture, building an active inference solution to the regulation problem of a linear multivariate system. To do so, we first define a generative model [15,18] for a system that prescribes 1) the dynamics of the plant to control (see equation (9)) and 2) how these relate to observations. The linear generative model is presented in a state-space form, similar to the the one expressed in equation (9), but is a rather different mathematical object: while equation (9) describes the "real" plant (i.e., its generative process [38,21,39]), in a generative model we write a set of equations embodying our assumptions regarding a plant that are used to derive update equations that define a controller. Importantly, the mapping between a generative process and a generative model is not necessarily one-to-one, and different generative models can ensure regulation while representing different sets of assumptions [9,96]. The generative model to regulate the same linear system previously introduced in equation (9) is thus defined as 4 : x =Âx +Bv + w y =Ĉx + z (13) where the hat over matricesÂ,B,Ĉ highlights the important fact that such matrices do not (have to) mirror their counterparts describing the world dynamics in equation (9), i.e., as explained above one can describe several generative models for a given plant. In the simplest case, this may simply imply that matrices A, B, C are unknown and should also be estimated [79,34]. More in general however, different matrices in a generative model can implement desired dynamics that substantially differ from the observed ones in order to obtain specific desired behaviours 5 as previously shown in for instance [37,38,10,13]. As we will discuss later, this constitutes a point of departure from the traditional assumption behind architectures built on the separation principle, where the variables described in LQG controllers reflect, by construction, the linear dynamics of the observed system, such thatÂ Furthermore, while in LQG one has to assume full knowledge of motor actions a for the unbiasedness of Kalman filters [85], in active inference this vector is not explicitly modeled, leading to a case where no copy of motor signals is available or even necessary, relying instead on a process of biased estimation [12] (cf. [32]). Active inference proposes that a deeper duality of estimation and control exists whereby, in the simplest case, actions are just peripheral open-loop responses to the presence of prediction errors on observations, irrespectively of the causes of sensations: self-generated, a, or external, d [36,41,20,1]. While our focus remains on the continuous time formulation of active inference, it should be noted that in more recent discrete formulations of behaviour under this framework, this account was extended with action cast as a problem of minimising expected free energy, inferring (fictitious) control states c or rather, time-dependent sequences of control states, or policies π c 6 associated to a set of actions a [41,40,96]. Importantly however, both these proposals rely on theories in neuroscience that suggest a lack of information on self-produced controls (i.e., efference copy [101]), proposing an alternative for effective motor control in biological systems [27,36,1,28,65]. The generative model thus does not describe directly the role of actions a as seen in equation (9). In their place, the vector v encodes instead priors in the form of external or exogenous inputs in a general state-space models sense, (cf. u in equation (5)), or biases in probabilistic settings. In this light, priors can be used as targets for the regulation problem (see equation (6) and equation (10)), effectively biasing the estimator to infer desired rather than observed states, with a controller instantiating actions on the world to fulfill the target (state or trajectory) of a controller [13]. Variables z, w model noise in or uncertainty about the environment in a Stratonovich sense, i.e., having non-zero autocorrelations (see Discussion).
Following the general formulation of the variational free energy under Gaussian assumptions (Laplace and variational Gaussian approximations) applied to the multivariate case, we define (dropping terms constant during the minimisation process): with a full derivation found in, for instance, [21,24,9]. Here ϑ denotes the set of all the hidden variables of a generative model, such that ϑ = {x, v, θ, γ}, with x, v defined above and parameters θ including the matriceŝ A,B,Ĉ previously introduced, while hyperparameters γ encode the stochastic properties of the generative model, i.e., the covariance matrices Σ z , Σ w and their possible reparameterizations.
With Gaussian assumptions on z, w, the state-space model in equation (13) can then be written down in a probabilistic form, mapping the measurements equation to a likelihood P (y|x, v) = P (y|x) (16) assuming that observations y are conditionally independent on inputs v. The system's dynamics are also then expressed as a prior [34] P (x, v) = P (x|v)P (v) = P (x|v) 4 It should be noted that Wiener processes in continuous time are often presented using a notation in terms of differentials dx, dt and dW where W is a Wiener process or Brownian motion, see equation (9). However, it is also possible to simply use a Langevin form as we do here even in the case of white noise, at least until an appropriate calculus (e.g., Ito or Stratonovich) is introduced and the appropriate interpretation applied [98]. Notice also that we adopt here a Lagrange notation for derivatives, with Newton's notation introduced later to specify the ensemble dynamics of the recognition dynamics, see [21]. 5 within reachability and controllability constraints [85] 6 called u and πu in [40].
where we assumed that inputs v are known, with their prior P (v) thus reducing to distribution with its mass densely concentrated around its mean (in the limit, a delta function). This assumption simply expresses the fact that in our current formulation of control problems, v will encode values assigned by us and representing the target-state or trajectory of the system. Since the probabilities densities are both multivariate Gaussian, they can be written as: where m, n represent the dimensions of vectors y and x and |Σ z |, |Σ w | are the determinants of the respective covariance matrices. By substituting equation (18) in equation (15), the variational free energy for a generic linear multivariate system becomes: where we replaced x, v with their expectationsx,v, since under the Laplace and the variational Gaussian assumptions, the free energy in equation (15) must be evaluated at the mode of P (y, ϑ), equivalent to the mean for Gaussian variables. In the same way, we then introduced precision matricesΠ z ,Π w as the inverse of the best estimate of covariance matricesΣ z ,Σ w , derived from an application of the Laplace approximation to covariances Σ z , Σ w [34]. It is important to highlight that, in general, the covariance matrices (or their inverse, the precision matrices) used in the generative model can in fact be different from the ones used to describe the environment or generative process [13]. The same approximations can in principle be applied to θ = {Â,B,Ĉ} [34], but to simplify the treatment (and in line with the idea of comparing active inference and LQG on equal ground), we assumed that these parameters are known quantities, even if different from their respective matrices in the generative process (see equation (14)). The recognition dynamics, prescribing estimation and control in a system minimising variational free energy [43,42,21] are implemented in standard active inference formulations as a gradient descent scheme on free energy with respect tox andx for estimation: This system for the update of the means of x and x is similar to the standard form of prediction and update steps in a Kalman filter for discrete systems [22,33]. The equations include a term D, ensuring the convergence of the scheme when higher embedding orders are also optimised, i.e., x , see [43]. This differential operator is defined so that Dx =x = 0 and thus gives 0 for all higher orders of derivatives Dx =x , Dx =x = 0, . . . that are normally assumed to be white noise (see discussion in [43]). Its use is equivalent to the presence of a-priori state estimates found in the update equations of traditional treatments of Kalman(-Bucy) filters, and computed in the prediction step. In practice the system in equation (20) collapses to a single equation when the update step (second line in equation (20)) is assumed to be faster: giving an equation resembling the Kalman-Bucy matrix equation for the estimated mean in equation (3): On the other hand, control is defined via a gradient descent on actions a, assuming the perspective of a system that can only infer that actions have an effect on observations y (i.e., no direct knowledge of how a affect the latent states x or their estimatesx): These equations are finally reported in Fig. 2, with the introduction of learning rates M and N to facilitate a more direct comparison.

A comparison of LQG and active inference formulations 4.1 Related work
In recent years, several reviews [19,21,17,47,23] have tackled different mathematical aspects of active inference, in order to analyse some of its claims and possibly fully uncover its potential as a general theory for the neurosciences. This note however differs in crucial ways from said reviews, offering a technical perspective that should be seen as complementary to previous works. In particular, unlike [19] here we focus on sensorimotor control rather than on pure perceptual accounts of cognitive systems. The current mathematical treatment builds on [21] where an explicit derivation of active inference in generalised coordinates of motion for non-Markovian univariate continuous time stochastic processes was introduced, inspired by more general formulations found, for instance, in [43,34]. Here we extend this formulation to multivariate systems to introduce a comparison with the standard LQG paradigm, inspired by work initially discussed in [11,12,9]. In [17,81,23] the focus is on discrete time formulations of active inference [40,39] based on partially observable Markov decision processes (POMDPs) and thus differ in fundamental ways from the work presented here which, on the other hand, relies on continuous time systems [43,38,21]. Finally, the work presented in [47] also focuses on discrete formulations, without including an explicit account of control and behaviour (similar to [19]).

Differences
As seen in previous sections, and summarised in Fig. 2, LQG and active inference share a common mathematical background rooted in Bayesian inference and optimal control. In practice, however, there are a few key differences between these two architectures for linear continuous time systems. Some of them are rather substantial and affect even more general cases, while others end up playing a relatively minor role, especially for the simplified linear systems presented in this note. Here we will discuss, in particular, differences due to: • state-space model formulations • action selection policies • minimisation schemes • cost functionals and general derivations

Different state-space model formulations
LQG and active inference both rely on state-space model formulations, however while LQG implements a more traditional one, active inference is said to introduce a definition of models in generalised coordinates of motion, i.e., higher embedding orders for continuous time models [43,34]. These models are equivalent to a continuous time version of standard treatments of coloured (Gaussian) noise, i.e., non-Markovian (Markovian of order N, or semi-Markovian) processes, in terms of augmented state-space models seen for discrete systems [50,34]. When the noise is not white, the typical strategy involves increasing the dimensionality of the statespace, treating coloured noise as an autoregressive model of independent white noise components that can be explicitly separated by introducing higher embedding dimensions that maintain an overall Markov property [50]. In generalised state-space models for continuous systems, random variables are treated as analytical noise with non-zero autocorrelation, replacing the (Markovian) Wiener processes typical of Ito's formulations of stochastic variables 7 and adopted in most standard formulations of Kalman-Bucy filters and LQG control. Wiener processes are usually considered a good approximation of coloured noise only when the time scale of an estimator is much slower than the true time scale of the dynamics of an environment/plant. In this light, non-Markovian processes should simply be seen as a natural generalisation of treatments based on Wiener noise, whose derivatives are mathematically not well defined in the continuous limit, thus making it less suited for models whose characteristic time scale more closely matches the real dynamics. This is often the case for systems studied in various areas of engineering [86,50], physics [29,99,69,44], ecology [48,100] and neuroscience [34,97,67], among others. Generalised state-space models use a Stratonovich' formulation that allows for differentiable (analytical) noise [16,86], often thought to be a better model for coloured noise [104,86,98,34]. This generalisation is claimed to allow for the treatment of non-Markovian continuous random variables in a more principled way where derivatives of stochastic processes are defined as in traditional (non-stochastic) calculus and included as extra dimensions of the state-space in terms of higher embedding orders (cf. the role of delayed coordinates in embedding theorems [77,87]). These "extra" embedding orders represent a set of coordinates expressed in terms of "position", "velocity", "acceleration", etc., for each variable and correspond to a linearised (for convenience [34,21]) path generated by a Taylor expansion in time of each trajectory. The differences between generalised and standard state-space models are however less noticeable for the linear case treated in this note, often used as a starting point for models of sensorimotor control in computational and cognitive neuroscience. This is due both to 1) the treatment in terms of white noise adopted in equation (9), making higher embedding orders redundant when the plant's model is known, and to 2) the white noise being additive. Under these assumptions, while the theoretical interpretations of Ito and the Stratonovich formulations still differ [98], they lead to the same results [50]. For nonlinear problems the discrepancies between these two approaches become more obvious, at the cost however, of analytical tractability since stronger assumptions are required for the treatment of more general cases. For instance, in LQG architectures, the separation principle heavily relies on the linearity of observations and dynamics, and only weaker versions of this principle are at the moment defined for some special classes of nonlinear systems, e.g., [7]. In active inference, the effects of the local linearity assumption on higher embedding order remains largely unexplored especially for nonsmooth processes. More in general, however, while it is sometimes claimed that active inference has a clear edge over traditional approaches Markovian noisem, such as LQG [43,42], one can show that non-Markovian systems can be formulated as Markovian ones using an augmented state-space [50,34], in the same way higher embedding orders increase the number of state equations in active inference [34]. Due to this, some comparisons between active inference algorithms and existing methods in the literature may appear at the moment slightly confusing. For instance, in [43] we see an analysis comparing (extended) Kalman-Bucy filters and Dynamic Expectation Maximisation (DEM, one of the standard algorithmic implementations of estimation algorithms in active inference). In presence of white noise, the two methods achieve very similar performances, while for nonwhite noise, DEM is claimed to display better results [43]. At the same time, while the number the state-space dimension for DEM was effectively increased via the use of generalised coordinates of motion, the dimension of the state-space of the (extended) Kalman-Bucy filter remained unchanged, thus suggesting that differences are mainly due to the treatments (or lack of) of coloured noise, with the (extended) Kalman-Bucy filter capable of replicating the same results with an adequate state augmentation.

Different update equations for action
As shown in Fig. 2, the update equations for action in LQG and active inference present a few crucial differences. Importantly, actions in LQG are implemented using an algebraic equation equivalent to standard negative proportional feedback mechanisms, while in active inference the same update relies, effectively, on an implementation based on biased perception and akin to integral control [13]. This is mainly due to the fact that while LQG requires full knowledge of inputs a to calculate the best estimatesx, active inference relies on an implicit mechanism to handle the lack of such inputs: integral control. In particular, the target value for the control problem, encoded by the vector v, is introduced as a prior in the form of a constant "disturbance", or bias, in the generative model in equation (13). This unaccounted disturbance generates a biased estimate (cf. [32]) that encodes the desired state/trajectory of a system, reached via the use of an integral controller that acts to "regulate" such bias [51,52]. Integral control can in fact be seen as an implicit mechanism to estimate linear (i.e., constant) perturbations/inputs, inferred by accumulating evidence based on steady-state errors generated by the presence of the bias vector term v 8 .
A second key point is that actions built in LQG schemes use prediction errors on hidden states, while active inference updates are based on errors on observed states. In LQG, this is due to an assumption on the invertibility of matrix C, mapping estimated statesx to observations y, see for instance eqn. 4.1-1 to 4.1-8 in [3]. Thanks to this assumption, the desired/target trajectory can be expressed directly into the frame of reference of hidden rather than observed states, adapting (thanks to the separation principle) a problem of output-feedback control into one of state-feedback. While this assumption holds for the linear systems defined in LQG under the separation principle, it is not trivially generalised to nonlinear cases where processes of perception and control have strong co-dependences [14]. On the other hand, active inference implementations can in principle easily provide approximate solutions to increasingly complicated problems of (sensorimotor) control for a reasonable choice of the peripheral (open-loop) "inverse" model, ∂y ∂a T [13]. Furthermore, it should also be noted that the update equation for action in active inference replaces the arbitrary positive definite weight matrix R, standard in LQG control, with the expected precision matrix of observation noiseΠ z (=Σ −1 z ). This move can be seen in light of the established duality of deterministic control and stochastic filtering/estimation problems first formalised by Kalman [56,57,58]. Unlike standard uses of this duality theorem, normally simply highlighting matching terms in the solutions of these two problems in the linear case under a coordinate transformation (including time reversal), active inference assumes that the matrix R in fact just -is -the expected precision matrix of observation noiseΠ z . The implications of this idea include, among others, an intrinsic "dual effect" of actions within the active inference framework due to the lack the conditions for the separation principle, cf. LQG [14]. This dual effect can be seen as an instantiation of the fundamental exploration-exploitation dilemma [26], portraying the time-constrained trade-off between inferring/learning about the unknown structure of a system and regulating its state to a desired target. The active inference formulation for linear systems constitutes thus an intermediate stage between LQG models where dual effects are not present [14], and more general dualities of estimation and control for nonlinear problems found for instance in [72,94]. These generalised dualities are related to the formulation of the information filter, a linear estimator propagating the error precision, rather than covariance, matrix. The information filter provides a formulation that simplifies the duality relations by rearranging matching terms, creating new and different dualities, and in particular by replacing a difficult generalisation of the matrix transpose operator with a second time reversal (for details see [94]). The same method based on an exponential transformation was likewise applied in path integral control [60,59]. In this scheme, one can also show how R ∝ Σ −1 w (rather than R ∝ Π z as in the Kalman duality expressed by active inference in the linear case) for a class of tractable (i.e., linear in a) fully-observable nonlinear problems where the conditions for the standard separation principle are not met (i.e., LQG emerges only as a special case [60]).

Different minimisation schemes
The updates proposed with active inference are apparently consistent with Kalman-Bucy filters, although an important difference is clear: the Kalman gain, K, and feedback gain, L are not explicitly computed in active inference. The Kalman gain, K, and feedback gain, L, matrices prescribe the optimal (i.e., minimum variance) update speed of estimates of hidden states and controls, while balancing prior information and new observations. Both K and L require solving Riccati equations involving knowledge of the covariance matrices of dynamics and observation noise in the first case, and weights representing costs for estimation and control in the cost-to-go function for the latter. In current formulations of active inference, the matrices K and L are not as clearly directly defined as they are in LQG architectures. If we consider only the Kalman gain K, the main reason is that active inference relies on a series of simplifying assumptions perhaps not best suited to computation, online, Kalman and feedback gains. In particular, while the Laplace [15] and variational Gaussian approximations [75] greatly simplify the variational Bayesian treatment of inference and control problems (and are, together, exact for linear, Gaussian plants), they are usually accompanied by further approximations. These include, for example, the post-hoc optimisation of the covariance matrix of an approximate density under the variational Gaussian approximation, i.e., performed after a certain number of observations [43] (although see [42] for an approximate online version). In general however, no equations of the Riccati type currently appear in standard formulations of variational free energy minimisation in active inference. Under further assumptions, for example by considering fading-memory Kalman filters, it is however possible to draw a more direct comparison that will be developed in future work. Kalman filters with fading memory can, in fact, be shown to be equivalent to a natural gradient descent on statistical manifolds ( [2]) in the univariate case, see for instance [73,74]. Following then the known correspondence ( [70]) between natural gradient and Gauss-Newton type methods used in active inference [34] for exponential family models, one can consider cases where active inference emerges as a special (i.e., fadingmemory) case of (extended) Kalman-filters, and then discuss a similar approach for the dual equations involving action and the feedback matrix L. It should be highlighted that, unlike repeatedly stated in the literature, we believe it is all but clear how the minimisation scheme used by active inference ought to generalise algorithms such as (extended) Kalman-filters beyond, perhaps, the use of higher embedding orders (however see above). At the moment, most practical applications simply replace explicit K and L with approximations based on the use of learning rates, e.g. [10], or on local linearisation methods [76] with varying integration time-steps [43].

Different cost functionals and derivations
A further point of departure between these models can be found in the cost functional minimised by the two methods: a value, or cost-to-go, functional for LQG, equation (10), and a variational free energy functional for active inference, equation (19). The most striking difference is that the former includes a time integral of costs, while the second one doesn't. This difference is crucial in nonlinear cases, or rather in cases where the separation principle does not hold: the minimisation of variational free energy can in fact be seen as giving a "time-independent" equilibrium strategy, generating a fixed control strategy independent of future observations [61] or equivalently, following [14], one can see the minimisation of variational free energy as implementing a feedback rather than closed-loop policy that assumes fixed dynamics and costs in the limit of an infinite time horizon [61]. At the same time, LQG methods based on the separation principle rely on the same (future) time-independence assumption [14], thus implying that the two functionals are not fundamentally different at this level. A more appropriate comparison may be drawn on generalisations of both approaches, path integral control/KL control on one side and the minimisation of expected free energy on the other, where active inference is claimed to generalise other control approaches [39,23], however this comparison lies outside the scope of this note, focusing instead on linear continuous time and continuous state-space models.
Finally, the free energy functional equation (15) appears to include extra terms when compared to the value function of LQG equation (10). The presence of multiple prediction errors in the variational free energy formulation is however just an expression of the probabilistic (i.e., Bayesian) derivation of inference methods [50], now generalised to control problems. The different predictions errors in the variational free energy directly map to likelihood and prior distributions as obtained from the joint density of observed and hidden states used to define free energy, see [21]. On the other hand, LQG derivations are often based on least-square methods [50,85] with no a-priori interpretation of uncertainty, normally included only post-hoc.