1. Home
  2. Explore
  3. Statistics
  4. Bayesian Inference

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Bayesian Inference

Transcript

Hello, my name is Dimitris Pinotsis. I'm a reader at City University of London and a research affiliate at MIT. For the next several minutes in this presentation, we will be talking about Bayesian inference. Inference is the process of reaching a conclusion about the likelihood of an event to occur or an observable to have a particular value. Bayesian inference is when this process is based on Bayes' theorem that you see on this slide, where the belief about

the event is given by the prior on the right-hand side. Then this equation, this theorem is used to take this prior probability, update it with data, with whatever is observed, which is called the likelihood, the second term on the right-hand side, and then on the left, the multiplication of the two gives an update of the probability, which is called the posterior probability. We all perform Bayesian inference when, for example, we play tennis. What you see on this slide is

three different snapshots after the opponent in a tennis game has kicked the ball, three different time points past that, at 50 milliseconds on the left, in the middle, 250 milliseconds, and the rightmost panel shows the state of the game, 450 milliseconds, after the opponent has hit the tennis ball. When we play tennis and we need to receive the ball in our part of the court and hit back and respond, we're forming a prediction about the location of a tennis ball.

This prediction, this belief about where the ball will be, is the result of two things. Our prior guess, which is based on, for example, what time of the day it is, how the weather looks like, how well we know our opponent, and what are their tactics, perhaps how much light there is around, is it day, is it night, is it windy? All these form our prior beliefs. But then once the ball starts coming closer to us, we have sensory data, we have likelihood formed,

and we combine our long-term predictions with on-the-fly estimates of the position of the ball. We combine, in other words, the green ellipsoid that you see on the slide here, which is the prior, with the likelihood, which is the red ellipsoid. This combination follows Bayes' rule and yields a posterior estimate, an update based on sensory evidence, which is the ellipsoid with the thick dark lines, black lines in particular. Now, this is the prior that goes into our next prediction.

At 250 milliseconds in the central panel, the prior of that second snapshot is the posterior from the earlier type point. This is something called Bayesian belief updating. The posterior from the past, as you can read at the bottom of the slide, becomes the prior for the future, so it becomes the new green ellipsoid that is combined now with the new red ellipsoid, the new sensory data or likelihood, and gives a new posterior, and so on. In general, when we try to

respond to the opponent hitting the ball, we employ green and red ellipsoids. The prior experience with sensory evidence, and we do that in an iterative fashion over time, over and over again. Interestingly, we use Bayesian inference not only when we play tennis, but also to make our neurons fire, according at least to some theories like predictive coding and the Bayesian brain theory. We will not go into more details here. I just wanted to highlight that Bayesian theorem and Bayesian inference

lies at the heart of how you might be perceiving the world in the context of these theories. Predictions and likelihood are again combined using Bayesian theorem in the context of these theories to calculate errors and then minimize them. In this setting, the goal is to come up with efficient models of the world, models that best predict sensory input, and through exactly the same iterative process that we saw earlier in the context of a tennis game, come up with stable neural representations.

Our focus today, however, is Bayesian inference and a basic mathematical introduction to its use. Let's start with simple stats that we all are familiar with, like correlations. A few years ago, there was this interesting title for a news piece at the BBC News website. Does chocolate make you clever? On this slide, you see the graph from the paper, where on the vertical axis, we have the number of Nobel laureates per 10 million inhabitants, and the horizontal axis is the chocolate consumption in each country. There is a clear correlation between the country's annual per capita chocolate consumption and the number of Nobel laureates. That's interesting, I guess. The reason that is interesting is because it seems, according to this study, that eating more chocolate improves

the nation's chances of producing Nobel Prize winners, according to this simple correlation. The question here is, whether eating more chocolate increases the chances of obtaining a Nobel Prize. There is no way to answer this question using deductive logic. It's all about hypothesis and estimates and probabilities.

There is a clear distinction here between what the presumption is, eating chocolate, and what the possible hypothesis or conclusion might be, which is getting a Nobel Prize. This is the probabilities that we're after in many cases, in real life or experimental science. This is what Bayesian inference allow us to calculate.

Bayesian inference is based on probabilities. Let's take a step back now and revisit the mathematical notion of probability. It is defined as a ratio between the number of times a particular event is observed over the total number of trials that cover all possible events or outputs. So when you have a dice, for example, as we all know, the probability of getting one out of six sides is one over six. Or if we flip a coin, the probability of getting heads or tails is 50%. As simple as that.

And another way to write the same mathematical definition a bit more rigorously is by including at the beginning the limit when the number of trials N goes to infinity. So to mathematically define the probability, we need to assume that we have repeated the experiments an infinite number of times. But of course, practically this is not possible to do. And sometimes we only have one trial that we can really carry out when, for example, we are thinking about the probability of raining or snowing tomorrow.

So what happens then? It turns out we can define two kinds of probabilities. One, following what we just said, the fact that we assume a certain experiment is repeated an infinite number of trials. And in this case, the probability of a certain outcome quantifies the variability in the expression of these outcomes. This is the so-called frequentist probability. So it's the frequency of a particular outcome or event in an infinite ensemble or number of trials. There is also the Bayesian probability that underlies, as you might guess, Bayesian inference. And this is a different kind of probability where crucially we have a distinction between premises and conclusions. Remember the example with the chocolate and the Nobel Prize winners? Same thing.

So in this case, the probability quantifies uncertainty. How uncertain or certain are we that a certain conclusion or hypothesis will be true based on some assumptions or premises? That's the Bayesian probability. Probabilities, both frequentist and Bayesian are defined over something called random variables.

So random variables are functions that assign a real number, in this case, the probability to its outcome in a sample space that here on this equation is noted by omega and is associated with a random process. If this sounds a little bit complicated, it's very simple considering, for example, flipping a coin. Flipping a coin n times, thousand times, is a random process. And then the sample space omega in this case, as you might already know, is heads or tails.

So what the outcome of its trial, its time we flip the coin will be, is a random variable. And then there is a mapping that takes these heads and says it's 50% probability for heads and 50% for tails. And this is a real number, of course, which is noted by this funny capital R, which is a set of real numbers. And you can have continuous or discrete random variables. And one particular example is the connectivity in brain circuits. This is exactly the sort of random variable

we have in applications like dynamic causal modeling. The connectivity in a brain circuit, or how let's say the frontal areas talk to parietal areas, for example, are random variables. And we can define probabilities of certain connections over those random variables. Often when we have brain data that on this slide are denoted by Y, we want to use this data solving this inverse problem. This is exactly what DCM, for example, does and get theta, which is the brain connectivity.

What you see here is not the random variable, but the Bayesian probability defined over this random variable theta, given this is what the vertical line is, given Y. And this, what it says here is that the distribution of this probability is normal. That's what you see on the graph with mean mu and variance sigma square. And the probability is on the vertical axis. The reason this is Bayesian is because if you remember, Bayesian probabilities always have some premise and some conclusion.

So here, the conclusion is that I have this particular value for brain connectivity theta. And the premise is that I have inferred this value using brain data Y. In the context of biological systems like the brain, where there is causality between observables and neural sources, we can change a little bit the name of premises and hypotheses into causes and effects. And to see what I mean by that, consider the example we just discussed, that we have some brain data recorded, for example, with electroencephalography that you see here on the slide. You see the map of different EEG sensors and different activities on the skull.

The different levels of depolarization recorded are given by different colors. You can maybe have brain waves. And you have some recordings Y. This is the wiggly or wave-like curve that you see. And on the left figure here, you see neural sources. This activity that is captured, like we said, with electroencephalography is generated by a network of areas on the brain, neural sources, four in this case, the disks with light yellow interiors.

And they have arrows, which means that they're connected and they generate this activity. So we have the connectivity, the theta, that characterizes the neural sources. And then we have the recordings, the Y. And the theta and the connectivity is basically how different sources, different locations, for example, X, Y, and Z on this slide, are connected to each other. And I'm using on this slide Y in two ways for the brain data, but also for the Y variable dimension,

the Cartesian dimension on this graph. So the Bayesian probability that quantifies whether there is a connection in between, for example, the frontal area and the parietal area, or a subcortical area, and this is responsible for the data Y we observe, is given by the equation you see here, theta equals a certain value. This is what the open brackets here, the square brackets with the dot inside. That's what they mean. And then this vertical bar means given Y. So that's the Bayesian probability.

If, again, my effect, what I observe, or the premise, if I'm getting this data Y, what is the hypothesis of the cause? It's theta. So this theta value, this connectivity, the way the brain is wired and how neurons talk to each other, might lead, might have as an effect the data I'm observing. This is why the data are a premise, because this is what I am observing. I don't know if the connectivity is there. I'm saying, what is the connectivity if I'm getting this data, which I know I am doing?

So these probabilities, like we said earlier, are exactly what Bayes' theorem allows us to calculate. It allows us to calculate Bayesian probabilities that are defined over random variables for causes and effects, premises, and hypotheses, in other words. And you see on the slide exactly the mathematical equation that connects those. And as you see, we have two sorts of probabilities defined there, where we either assume that the cause is given, and then we have the forward probability

that you see on the top here, or we have the inverse probability, where we assume that the effect is given, like in the example with the brain data we just discussed. Now, there are multiple causes that might lead to the same effect. So we might have a similar sort of, let's say, frontal alpha activity or gamma activity or occipital alpha. So multiple configurations of neurons and interacting neural sources might lead to similar or the same pattern of data.

This is why we say that the problem of finding the causes giving the effect is an ill-posed problem, meaning there is no unique, there is no single solution when we try to infer what cause was there for a particular effect or data. Many different neural configurations might lead to the same data. On this slide, we see a generalization of the example we just discussed, where instead of a single random variable, the connection between a frontal and a parietal area, for example, we have both the forward and backward connections, theta1 and theta2, with different means, mu1 and mu2, between the two areas. And you see the two-node graph on the right-hand panel here. So the probability here is defined over a multidimensional random variable, theta bar, that includes both theta1 and theta2.

And this is, again, another example of a continuous random variable. On previous slides, we obtained an understanding of probabilities and an intuitive grasp of Bayes' theorem and how this can be used for Bayesian inference. What I would like to do in later slides is show you the equation and how this can be obtained. And to do that, we need to understand how the equations and the calculus of Bayesian inference works. And essentially, this boils down to three main rules of probability that you see on this slide.

All of them are somehow intuitive, and you will see what I mean by that in a minute. Excuse me. And this is also what a famous French mathematician meant by the quote on the bottom of the slide, that probability theory is nothing but common sense reduced to calculation. So the first rule is called normalization rule, and it's the intuitive conclusion that when we sum probabilities of four possible outcomes, the sum should be 100%. The sum of raining tomorrow or snowing

or having sun or having a cloudy sky, all of these are different A's. And if I sum all these different probabilities of a certain weather tomorrow, this would be one, because probabilities are defined as fractions of one as opposed to percentages. But it's the same idea. Now, the second rule is called the sum rule or marginalization. What does it say? Imagine that we have two things, is A being or two outcomes, being what sort of clothes I'm wearing tomorrow,

and B is whether I'm going to work or somewhere else. So let's say B has a particular value and is the outcome that I go to work as opposed to staying at home or doing something else. So the probability of B, which is the probability of me going to work, is what is on the left-hand side of equation two. And this equation says that it is equal to the probability of A,B when it's summed over all A's. And remember, what is A? A is the outcome with regard to my clothes.

So the probability of me going to work tomorrow, P of B, is equal to the sum of all probabilities that I go to work wearing any clothes. So A is all possible outcomes in terms of clothes, jeans, shoes, I don't know, chambers, whatever you want. And basically I'm summing and I'm throwing away A to get the probability for B only. The third rule, again, gives a different expression with regard to the joint probability A,B. And what it says is that this is equal, we read the equation first,

to be the probability of A, vertical line means given B, times the probability of B, and alternatively is the probability of B given A times the probability of A. So basically what this says, that P,A,B, my probability of going to work wearing jeans, for example, I pick this value for A and B, is equal to the probability of me wearing jeans, given that I go to work, times the probability that I go to work, P of B, and this is also equal to the probability of me going to work given that I wear jeans. So given A times the probability of A, the probability of me wearing jeans. And this is called conditioning or product rule because I have this multiplication. So let's keep this in mind, these three rules.

And the last is about conditional probabilities. And this is again, what a vertical line B means. And remember, this is different, from the marginal probability of A alone, as you see. And this conditional rule, that we just discussed, P of A,B, is equal to P of A, given B, times PP, or again, equal to P of B, given A, times P of A, is essentially Bayes' theorem. So it's a way, remember, from going from the probability of A, given B, cause and effect, to the probability of B, given A, effect given the cause. That's what Bayes' theorem does.

So recall from the previous slide, the equation connecting P of A, given B, with P of B, given A. This is exactly, Bayes' theorem, when we just apply a small twist. What is the twist? The twist is that we use the sum, and the product rules, from the previous slide, to rewrite the probability of B. So this is what you saw, Bayes' rule, P of A, given B, on the left hand side, the main equation here, is equal to P of A, times P of B, given A, and what should be, in the denominator, what was earlier, multiplying P of A, given B, which is P of B. But then what is P of B?

The probability, for example, of me going to work. It can be written, using the sum rule we just saw, as the sum over all A's, of P of A, comma B, the joint probability, remember, what we just said, previously. And then, this in turn, can be written, using the product rule, as the sum of P of A, times P of B, comma A, for any value of A, and this is exactly, what you see, in the denominator, and this is also known as, likelihood. So this is essentially, Bayes' theorem, that we saw earlier,

if you remember, with the tennis game example, and also, we said that, maybe the brain, and the neurons, are implementing, also, this sort of, equation, when they, represent, information, and they come up, with stable, neural representations. So now, think of A and B, having some, cause and effect, relation, over time, and defining priors, and posteriors, this equation, is exactly, what we saw earlier, for Bayesian belief updating, for example, so when, we said that, we can take,

a prior probability, which would be, P of A, in this case, then update it, with the likelihood, which in this case, is P of B, given A, and then we get, the posterior, which is the P of A, given B. So we get, the posterior probability, and you might recall, our earlier example, with, chocolate consumption, being correlated, with the number of, Nobel winners, and, this is basically, the application, of Bayesian rule for this, you need to decide, what your cause and effect, will be and,

accordingly, what the posterior, and prior, and likelihood terms, will be, and this is, a practical issue, it's, perhaps, easy to go and ask, Nobel prize winners, how much chocolate, they consume, and this would give you, essentially, the likelihood here, the chocolate given, that I have a Nobel, and then you know, perhaps, what is the frequency, or the probability, of getting a, Nobel prize for its country, and this will give you, basically, your posterior, which is, how, likely it is,

to get a, Nobel prize for a certain, consumption of chocolate, so, with this, we're coming towards the, last part of the presentation, which has to do with, essentially, applying Bayesian rule, using the SPM, software, and, what you see on this slide, is, a way of, updating, your prior beliefs, assuming, that these probabilities, are Gaussian, so you have normal, densities, and you have only one, variable here, and the, the variable is, essentially, beta, a certain, level, in your,

in your model, that tries to explain, your data y, and there is, some random, term, some random noise, with the observation noise, that is denoted by, e, so the equation is, that your measurements y, are equal to some, beta parameter, plus a variation, around this, so let's think about, temperature for example, in this case, where, what you record, is, with your thermometer, is an approximation, of the, real value, out there, with some small error, that relates to your, measurement device,

and the error is, e, so what you want to, to do here, now, is using your, recordings, get a value, for, your posteriors, essentially, so your posterior mean, it turns out, if you apply base rule, here, is the precision weighted, combination, of the prior mean, and your data mean, the likelihood, so let's, take it step by step, and see what the, equation tells us, it tells us that first of all, the green equation, that you have some prior guess, about the, true, state of the nature,

the true temperature, which is some Gaussian, with the variable being beta, and then it has some mean, mu of some p, and some variance, one over, alpha, some p, and then of course, you have your, likelihood term, which is denoted, in blue, and this is not a Gaussian, and again these are assumptions, of course, but you could do it, for some observable, you can say, I'm reading something, with a certain mean, and certain uncertainty, that is given by the variance, so the probability,

of getting a measurement y, given that the real, value of the temperature, which is beta, is another Gaussian, over y, this is the blue box, with mean beta, and then variance, one over alpha sub e, and the variance, is the variance of the noise term, e, and this is your measurement right, because this is, over y, the data you're getting, and then based on your prior, belief about the temperature, and your data, you can use Bayes rule, to get the red Gaussian, and this would be another Gaussian,

so what is the probability, that the real temperature is beta, given that you observed, you recorded some value y, this is the probability, in the red box, and this is another Gaussian, with mean mu, and variance one over alpha, and if you use Bayes rule, and you assume that, all these are Gaussians, what are you getting, we're getting the results, in the black box, where you have an expression, for the variance, in your posterior, alpha, is the sum of the two variances, of your prior,

variance and of your noise, variance a sub e, plus a sub b, and the means, is like we said, this precision weighted combination, of the prior means, so mu, in the last line, in the black box, is one over alpha, this is the precision, that weights, and then parentheses, a sub e y, plus a sub p, mu p, so essentially, what the observation, and Bayes rule, allows you to do, is to take your green bell, or Gaussian curve, and based on your recordings, the red curve, sorry the blue curve, the likelihood, of getting a posterior, estimate, for the temperature, which is given by the red, Gaussian.

On the previous slide, we applied Bayes rule, and using pen and paper calculations, that I didn't show, we obtained the posterior, distribution, starting from the prior, and the likelihood. On this slide, I'm going to use a similar example, in the sense that, the mathematical equation, is very similar, to what we just saw, and, consider the general, linear model, and then use SPM, to show how, the software can, compute the posterior distribution, in this particular case, using variational Bayes,

particular algorithm. So what is the general linear model? We have, similarly to the previous example, on the left hand side of the equation, data Y, that you see, it's a 20 by 2, for example, matrix, of data points, on the right hand side, you see the graph, where the crosses, are very different data, and the assumption is, that the model, that leads to the, generation of these data points, is given by a GLM, so it's X, the design matrix, times some parameter, beta, and it's actually a vector,

so it has a bar, on top, plus a random term, epsilon, for noise, similarly to the E, that we had, in the previous equation, in the previous slide, so here we have, two coordinates, for our data, because they are, on the Cartesian plane, the X coordinate, and the Y coordinate, and these both, form the Cartesian coordinates, and get into the vector, Y, our data vector, and X times beta, is basically a line, the blue line that you see, and then the term epsilon, is the distance,

from the line to its point, this random term, you see also that, epsilon is normally distributed, with mean zero, and variance, sigma square, and we have also beta one, and beta two, as the two model parameters, and the design matrix, has a column of ones, it could be the overall mean, and then it has a second column, with some covariates, for example, this could be H, or some other demographic, so this is a classical GLM, and what we'll do, is see how this, posterior distribution, can be computed approximately, using an algorithm, in case that we cannot, get a direct application, of Bayes rule, or Bayes theorem, using pen and paper, calculations.

So recall, that the posterior, following Bayes rule, is given when we know, the prior and the likelihood, so this slide, defines these two functions, or probability densities, to be precise, so the prior over the vector of betas, is a normal distribution, with mean zero, for both beta one and beta two, and the uncertainty, is given by a diagonal matrix, where the variance, is one, and there is no interaction, between the parameters, the likelihood term, is what you see on the top line,

y given beta bar, is again a normal distribution, with mean, given by the linear term, the design matrix times beta bar, and various variance, matrix sigma, where sigma square is on the diagonal, for its data point, so simply what this says, is that our predictions, for the data, the model is x times beta bar, the linear term as always, and the uncertainty follows, a normal distribution, with variance equal to sigma square.

We could, do pen and paper calculations, for the posterior, in this case, because again, we have normal densities, we'll do it differently here, like I said, because this approximate way, that we will use, using the software, using SPM, can be used also, not only linear models, but also non-linear models, recall what do we want here, we want the posterior density, p for beta bar, given y, and this is equal to, p of y given beta bar, times p of beta bar, over p of y, where p of y, remember,

can be given using the sum, and the product rules, as the integral of the summation, of p of y, given beta bar, times p of beta bar, when I marginalize, and again, of Bayes rule, now using an algorithm, for approximate Bayesian inference, which is called variational Bayes. Calculating the denominator, in the case of non-linear problems, not for GLMs here, but in more general cases, like dynamic causal models, where we have biophysical neural networks, so in those cases, it's tricky or challenging to marginalize the parameters from the joint density, and get p of y, so I get this evidence integral, and in those cases, we use approximate inference, or variational inference algorithms, where the term variational, is there to denote that we use some

variational densities, to approximate the posteriors, so we have this density q of beta, which is approximately the posterior, when we, for example, fix the parameters, or the hyper parameters, if we are using variational Laplace. Another change we make, is that we talk about the log of p of y, to make the computations easier, and this is approximate model evidence, it's called, or free energy that you might have heard, in the context of dynamic causal modeling, or even predictive coding.

We won't have time to go into too many technical details here, the main thing is that we have an algorithm for computing the model evidence, and it's approximation, and the lower bound of this, is called free energy, and it's very useful, for example, for model comparison, as you will see in the DCM lectures. On this slide, we have a summary of the equations we want to solve, we want to find the posterior, given by Bayes' rule, again the challenge is that we cannot calculate with pen and paper, as we did earlier, and the main problem is finding the integral in the denominator, the model evidence,

in the case of nonlinear problems this is intractable, it cannot be computed explicitly, so to do that, we do two things, we take the log, for mathematical convenience, so we calculate the log b of y, and we find the bound, which is called free energy, and this is something used, for example, in dynamic causal modeling, for model comparison, for finding neural architectures, or alternative neurobiological mechanisms that might be generating brain data, and this approximation to model evidence is denoted by tiot, this approximate equality and is called free energy, is the f that you see on the bottom, at the right-hand side of this slide.

So approximate inference is implemented in SPM by a couple of different routines, the main one is what you see at the very end, on line 24, on this page, SPM NLSI, nonlinear system identification, for inference, basically, underscore GN, for the particular variant of the variational base algorithm used here, so this is what we will implement base theorem, and this needs some arguments in a certain way, so we need to define, going from bottom to top, for example, the model,

so the integration scheme m.is, which, as you see, on line 20, is x, our design matrix, times p, p is the parameters we're using, another way to say parameters here is bidas, so we have the model on line 20, it's a generalian model in the case we're considering, it could be a dynamic causal model, for example, in DCM applications that you will see later. Also, on line 12, and line 13, I should say, and 14, and also line 17, we have the prior density, the prior has a mean and a variance,

our covariance matrix, so m.p on line 14 is the log-scaled prior, which is 0 for convenience, because it's log-scaled, this means we have 1 as a prior value, and the prior covariance is also 1, like we saw on the previous slide, and this is the m.pc entry on line 17. Line 10 has, again, our model, and it defines the data, y.y equals x times b, or it could be even p, plus e, where e, that's the noise term defined on line 1, is random noise around n,1 where n is the number of observations,

for example, of subsets that we have, over 16, so we assume this variance effectively of noise, b, again, is our prior guess for parameters, line 8, these are, again, generated by a random function, there are two parameters, so it's 2,1, and line 7 and 6 define the design matrix, which essentially has 1 in the first column for overall mean, and the second column defined on line 7 is, again, random numbers, like we said, it could be demographics, like age, or something else, and that's basically what we have, n is the number of observations defined on line 5, and we have 20 people that we are considering in this case, in this simulated dataset.

On the last line, from the previous slide, we saw what the outcomes of the SPM and LSI-GN routine are. Remember, this routine implements variational Bayes, so it allows us to implement Bayes' theorem in a numerical way when we cannot do pen and paper calculations, like I said a couple of times, and the outputs are the posteriors for the beta, for the model parameters, and also the free energy, so once you hit the button and you run this in the command window, you see

these outputs, so you see, first of all, that you are implementing the EM algorithm, this is another way to call variational Bayes, particular flavor called expectation maximization, you have different steps because this is applied in an iterative fashion, and so you have step 1, step 2, step 3, you see the number on the left-hand side of the screen in the command window, and you see also the values of the approximate model evidence called free energy for each step,

so you see that, for example, at the beginning you start from some sort of baseline 0, and then step 2 is 1.156 to the plus 1, etc., and you have also the change of the free energy for each iteration and its actual value, these are technical details that we don't need to worry too much about. Once the algorithm converges, and the free energy and its change reaches and goes below a certain threshold, we have the end of the iterative process, and we also get the posteriors, so you see here the posteriors are minus 0.2595 and 0.6128, what are these? These are the values for bidas calculated using approximate Bayesian inference, based on the priors that we defined, and the likelihood, in other words, the data we gave to the model.

The second thing that pops up once you see, you hit the button, you run the code that I showed earlier, besides the outputs in the command window, is the SPM window with some graphics, there are two plots, one at the top, another at the bottom. The top plot has the data and the model prediction, and you will see that the solid line converges for its time step to the dashed line, so the blue and the red, in this case, coincide after step 14. At the bottom plot, you see the posterior values for

the beta parameters, and you have two bars because you have two bidas, and the blue bars here is a deviation from the prior value for each of the two. So essentially this is your posterior depicted in a graphical manner. So the summary here is that for nonlinear models like dynamic causal models or any model of your choice, you can use SPM and nonlinear identification algorithms to implement approximate Bayesian inference. This brings us to the end of this presentation, and I'd like to thank you all for your attention, and also thank colleagues that are listed at the bottom here for previous versions of this talk. Hope you are enjoying the course. Bye.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent