 OK, so welcome everybody. So now we definitely increase the level of interaction. So the objective of this lecture is that you do something yourself. And therefore, before I start, I have to know who has a laptop, or many, and who is able to calculate things on this laptop. That's good. Because part of the focus of the entire training school is that we somehow operationalize our knowledge, so not only listening to what kind of fancy formulas we are able to produce on a PowerPoint slide, but we want to operationalize it. And that's the reason we start with a very, very straightforward example. It's actually an example on structural optimization. So this already contains this risk aspect we are heading to. But we also do this structural optimization conditional to data we observe in tests. And the example we set out is as simple as you can imagine. It's a simple supported beam from a very conventional material. It's just steel. It's a steel beam. And by the optimal design of this beam, we somehow go through all the different steps from a formal decision analysis. That's the idea. So the idea is then after I have presented something for like a quarter of an hour, you already have enough information that you can make your first calculations. And of course, I assume that the level of background or background in somehow fulfilling this specific task is maybe a little bit varied among you. So therefore, it's maybe also an idea that we build groups about four people on one computer, three to four people, and I try to implement these things in groups. And I will not give you any advice which program you knew you use, which tool you use on your laptop to calculate these things. But the results I have produced, I did in MATLAB. But this is very compatible with, for instance, Python. And this example you can even calculate also with Excel, if you want. So it's possible to calculate just with some program you have on your laptop. But before we start, I want to make the big round on what we are doing as engineers. So I suppose we are all kind of engineers here also to kind of welcome you. Very nice picture of a European city. Guess where it is? Oslo. Oslo. Oslo, you see here the Oslo Opera House. Here you see the main city building. It's a very nice city. But what we see mainly, the message here is we see the build environment. The build environment contains infrastructural elements, buildings for offices, housing, cultural events under the earth. There's also all kinds of infrastructure you can imagine. So this is just an example of a piece of the build environment that is actually built to support our societal activities. But what you also see is you see many beams, you see many slabs, you see many columns, you see many structural parts. We as structural engineers normally like to address our problem settings too. So this is actually a cohort of thousands of millions of structural components. And these structural components they are somehow managed, they are somehow designed and developed following some rules. And when we develop this infrastructure, when we develop this structure behind this build environment, we follow a certain strategy. So what is the strategy we follow? So the components they have to be safe enough. They should not consume too much resources. And they should be somehow developed in a context of economical growth, so it should be also somehow cost efficient to develop them. And when we make a decision on such a component and we will have such a principled decision on a structural component, we have to follow and incorporate such a strategy in a kind of logic. And to make a long story short, if we go to this picture again, you had it already from Sebastian, but what is so nice and what is so beautiful on this concept? It's, of course, the principle of the Bayesian decision analysis. We have here the a priori analysis, the posteriori analysis and the pre-posteriori analysis. Sebastian talked extensively about that already. But what is the quality of this? Why do we follow this? What is the basic attribute of such a framework? You can make decisions. You can somehow structure your decisions. You maximize the benefit, exactly. So you maximize some utility. So you define a utility and you have a rational framework in order to attain this utility. And what I just said is rationality. This is actually something important. What does rationality mean? In our context, there are many, many definitions. And then I now come up with some possibility. We can have a five-hour discussion of whether it's worthwhile to discuss different things. It's worthwhile to discuss differently. But rationality can be seen as setting up consistency between our beliefs and our reason to believe and our action and our reason to act. There's two sentences that are very heavy. So you can digest them a little bit. But when we just use these principles and we seek for a strategy, for a concept, for a framework that somehow brings us close to this kind of rationality, then maybe we end up in a Bayesian decision analysis. To go even further when we talk about reason and our strategy to reason, we might also bring this back to some basic questions. Old German philosopher once asked when he was actually thinking about pure reason. He was asking, what should I do? What may I hope? What may I hope? And what can I know? And these three questions, they are all included here. So it's what should I do? This is about the action. What may I hope? It's about the utility. And what can I know? That's actually the interesting one. And that's the one we address in this training stool. So it's the exploration of, do we know enough to make this decision? It's the exploration of, did we set up our model complex enough to give a sensible answer to our decision problem? And when we have opened up the Bayesian decision problem in a way that we also seek for optimal choice of representation that's actually referred to that. How can we represent our problem optimally? Thinking about some resources, resources, a complex modeling might consume and thinking about the possible benefits this increase of complexity might give. And then we come very, very close to a situation where we might argue this is just the best we can do. And this is something we need as engineers, especially in critical situations, in critical decision situations. Sebastian already mentioned that we have to be careful with such a technocratic framework because the outcome of such a framework can be totally misleading. But as long as we are critical enough and explore this direction of this decision tree of what can we know and try to represent the best practice that is somehow inherent to our engineering community and then we might argue that this is just the best we can do. And that's really a beautiful aspect of this concept even so the decision tree looks somehow simple. In realistic problems it does not look so simple anymore. But now let's keep it as simple as it is and let's look at a decision problem that is maybe the most basic decision problem we know in structural engineering. It's a decision problem of the optimal design or optimal choice of cross-section of a structural element. And then we look how information might somehow affect this optimal decision. So information is an important part of this decision making. And before I come to the example I just want to highlight and maybe also come back to a discussion we had before about the indicators. When we look at information it's always useful to think about what kind of information do I have. So first of all we can distinguish between direct information and indirect information. So this is already a critical distinction closely related to the discussion about the indicators we had. So direct information is information about a variable that is directly part of my model that represents an event that leads to consequences. Indirect information is observation on a variable that informs me about the variable that is directly included in this model. So an example is when we are interested in a failure event then we might be interested in load bearing capacity. And when we make measurements on the load bearing capacity of this material then this can be seen as direct information on the load bearing capacity. But we might also look at structural elements and only measure the stiffness. And we know that the stiffness is somehow correlated to the ultimate capacity. So this would be indirect information about the ultimate capacity. So when we get information about the stiffness we have indirect information also about the ultimate capacity. And then here we distinguish between equality type information. This is when we get exactly an observation on a value and inequality type information. This is the information that we know that the value is larger than a certain threshold or the value is smaller than a certain threshold. This is also very often the case. We very often have such kind of information. And inequality information is for instance also when we have a structure that is already installed and we observe that this structure survived a certain loading referred to as a proof load. And then we know that the structural resistance of this structural part is larger than the load effect induced by this proof load. So this is also kind of inequality information and of course we can use this kind of information in order to learn more about the representation of the events that lead to consequences. And in our context, now in this context of this lecture this is just failure, right? So let's get started with this problem and you will type into your computer and calculate in just some minutes. So we consider a steel beam bridge with a span of 20 meters. So it's the most simple structural system you can imagine. It's a simple supported beam. And the beam is exposed to a load effect. I'm sorry for the misprint here. It's the load effect Q that is already given in the moment unit. It's a kilo-mutant times meter. So it's the load effect on this beam. And as we have steel we think about the section modulus. We want to have this beam to have in order to somehow minimize the expected costs that are associated to this beam. So we assume that the steel yield strength and load effect are represented as normal distributed. Random variables is a very, very simple assumption but that makes the calculation a little bit faster we want to do. And we consider Q representing a 50 maximum distribution of load effect. So we have some parameters given for the normal distribution. So we have the steel yield capacity and we have Q. And we have some costs. For instance we have some costs for the steel or we have some other variables. Then costs also. We have the span of 20 meters. We have some fixed construction costs and we have some variable construction costs. Or we have some variable construction coefficient that is multiplied to the choice of W. And then we have the direct costs of failure. It should be the indirect costs of failure H which is expressed as a function of the fixed construction cost. So this is now many, many assumptions and you don't know of course how to put them in your example. But first I give you some hints then. First we look at the three tasks we have to do. So the first task is we should find the optimal choice of W. Section modulus. The second task is after we have observed some data on the yield capacity what would be the optimal choice then. And the third task is how many experiments, future experiments where we don't know the outcome but how many experiments should I do given the experiments have some costs. And I hope most of you see that this is already the onset of Bayesian decision analysis from all three different perspectives. We have a prior analysis here, we have a posterior analysis here and we have a pre-pastoria analysis here. And we use data, we use a normal distribution, we use some very, very simplifying assumptions considering this distribution and our knowledge about the distribution. And in real problems or in more advanced problems this gets much more complicated, everything. But by having this example we have everything on the table, we have done the entire analysis and maybe we also get a feeling on our fingertips what this analysis is about. So let's get started with the first task and some additional information. So first, maybe I should mention that we, because I don't know what your particular background is but I assume that you are able to calculate a failure probability based on two normal distributions. So when we look at the limit state function defining failure, we have the limit state function as a function of r and s and we might define this as w times r, it's of course q, I'm sorry, minus q. So that's the limit state function. We have two random variables, r and q, they are normally distributed and that allows us to evaluate the better index, right? And we are able to express this better index as a function of w. So I leave it to your groups of three or four for the equation for the better index but what we want to have is a better index as a function of w and also a probability of failure as a function of w, right? So this is something we have to establish. And as we see this functional relationship between the decision variable and such a structural optimization example and the probability of failure is the information we need to have. And this functional relationship between the failure probability and the decision variable w goes into this objective function. So the objective function in very simple terms is the expected total cost as a function of w which we want to represent as a construction cost as a function of w and the expected ultimate failure cost as a function of w. So here the construction costs are split up in a fixed construction cost so these are the construction costs you always have independent of the choice of w. You can imagine in a practical example you have some cost components that not directly depend on your choice of w, right? For instance you have to transport the beam to the construction site and things like that. You have to employ some workers to install the beam. So this all goes into the cost independent of the choice of w. This is c0. And then we have a cost that is directly proportional. That's also our assumption, directly proportional to the choice of w. And that's the c1. So the construction cost is a direct function of the choice of w and then we have the failure cost and the failure cost are the construction cost because we consider that when the structure has failed we want to rebuild it because the societal need for the activity that is supported by the structure will remain even so if we have a failure so we have to reconstruct it. And then we have this age this is the indirect failure cost this is all the cost that comes up on top to the reconstruction cost. You can imagine when you have a failure then you might have some damage of installations you have some property damaged you might even have some fatalities that all goes into age. And of course we want to have the expectation so we multiply the failure cost the cost for given failure we multiply by the probability of failure. And the probability of failure as we see here is of course a function of w as bigger this w gets as lower the probability of failure gets. So we have this functional relationship between w and the probability of failure. And then of course when you have this objective function then we want to find the minimum so this is now also a super simplification to a full Bayesian decision analysis where we might have a very complex formulation of utility so here we just look at the expected cost and our utility is somehow our objective is to minimize this expected cost. So we want to minimize this by changing w we want to find the minimum of the expected total consequences. And this for task number one this information should be enough together with the values on the two tables on the slide before. So now I ask you to find some colleagues maybe the colleagues who already sit together on the table and implement this example and find the optimum estimation estimated working time is 15 to 30 minutes. Have you received the document from the file share? No. So I swap between these two slides and then you can also make your notes. But do you have any questions to get started? Yes. That comes out from this optimization, right? That's actually the sense of this exercise is that the absolute value of the probability of failure only is a side product of the entire analysis. So we are mainly interested in the minimization of the costs. But then when we have the results we might discuss about the absolute value a little bit further and how this could be treated in a real project. So concentrate on this objective function and on the values here on that slide. Any more questions in order to get started? Maybe I have over seen some basic information or is it clear? It's a beam we don't have to care about the statics because we directly have given the load effect. So this is already the load effect and this is then just something we multiply to the resistance, to the yield capacity. But of course the physical meaning is that this is the section modulus in this context. Good. Then I go around and try to look over your shoulders and you can have also individual questions to me. Let's do it. Good. I already have a system template. I have read it in advance. I forgot to tell you something. If you explain it too quickly. No, no. I don't know what to do. You can just listen to me. I don't know what to do. Is it just a priori problem? Yes, first. At the first stage I present the result. Can we define, for example, this function through the Monte Carlo analysis? No, you don't have to, Monte Carlo. But I can show you how to calculate this in very easy terms. The better. You use the Cornell Reliability Index? R minus S? No. I will explain. I just realized that there's a further hint needed. So there was a question from one group whether it's a good idea to use Monte Carlo simulation for the probability of failure. Monte Carlo is always possible. It's always a good choice. But in this it's a little bit an overkill. Because what we get here, we can actually calculate this better as the difference between the mean value of R times W minus the mean value of Q. And here we have the square root of the standard deviation of R squared times W squared plus the standard deviation of Q squared. So this is the better and then the probability of failure is equal to the standard normal operator of minus beta. And that's the smarter solution for the failure probability. Yeah, you don't need it. What you need is only this here. You only need this. So the cost of steel is actually not directly relevant. It's just to give you the feeling that we are talking about real numbers. So what you need is the C1 here. Because it's the expectation, that's the risk. I explained again. So I received the question several times about this construction cost. So this term, this is just the same than that one. And the reason we multiply it by failure is that we consider the entire part here in the brackets being the failure cost. So if we have failure, we want to reconstruct the structure. So we have to invest or implement the same design as before. That's the reason. So here this is just C0 plus C1 times W plus H. What you wrote there, should we observe section modulus as a variable or as a constant? No, that's your decision variable. So the section, you want to find the optimal choice of the section modulus. Yeah, but do we need to take it as a stochastic variable with distribution? No, that's something you make the parameter study about. So for start, we say it's a constant because it's like that that we can solve this manually in ETSU. If you look it as only absolute value. Yeah, of course. But then in Excel you would just look at thousands of different W's and then you look which minimizes the expected. Yeah. And? Huh? A unit problem. There's still something missing. No, you just have to multiply it. You multiply it with W. Well, it also depends on the area of ​​the W you're looking for, right? Yeah, but that's kind of... That's critical, isn't it? Yeah, but it's in the largest order, something like that, 10 million or something, right? Yeah, the strut value is way too small, isn't it? I can tell you the result now. Ok, who's coming close? So the first step is maybe when I refer to the lecture notes I wrote. So the first step might be to establish this functional relationship between the failure probability and the decision variable, right? So here W is considered as the decision variable and here you get also an idea. So it's measured in a millimeter cubic and it has very, very high numbers, right? So you search for something that has the order of magnitude of 3 million. But then you can relate the choice of W to system performance or to the probability of failure in this case. The better index and the probability of failure in absolute terms. So that's something you establish by using this better formula, right? Or in a parameter we have an observation of one of these parameters of this function of failure? Yeah, exactly. Let's have a dinner right away. Let's discuss it together. So it would be nice if we could continue this a bit further in the back. Oh yeah, we have to do that. That would be the best way to do it. But it doesn't work in the first place. Oh, I get it. Yeah, but that's a very simple example. We already have problems with that, right? So it's not that low. No, no. We already have a problem with implementing it. We don't ask what is a normal distribution and what is a metlap of the command. Yeah. Yeah. Yeah. Yeah. Yeah. It would have been ideal if it had been there a few weeks ago. Yeah, of course. But I had deadlines. Of course. That's how it is. But we can already get through it here. That's possible. But if we continue this a bit further in the next year, and we can also try to do this in this right-hand guideline. Yeah. That's a principle example. Yeah. I also do that in my lecture. Yeah. Yesterday I did that. I don't have much to do with Bayesian statistics in my lecture, but it's relatively straightforward. I think it's good. Yeah. I've always liked the Bayesian information stuff because I think it's designed in a more targeted way. Yeah. Yeah. I think it's really good. Mm-hmm. And I would be very interested to work with you. Yeah. Yeah. And I hope that we can discuss this in the future. Yeah. Yeah. Yeah. Yeah. Yes. We find this function. Yeah. Yeah. Yeah. Normal distribution with a mean value of zero and the standard deviation of one, but if you don't, if you leave this open, then this is the default. Okay. But how can it calculate probability of failure based on beta? You will get in beta. So it's the normal of beta. Yeah. So if we, if we, Well, beta has input. Yeah. It contains all the mean... Yeah, as I wrote here. So the probability of failure is this phi of minus beta. Yeah. Of minus beta. Okay. Right. Yeah. So ladies and gentlemen, I also had some questions. So this is the standard normal operator. It's the standard normal operator. This is just a normal distribution with a mean value of zero and the standard deviation of one. And when we take minus beta of the standard normal distribution, then we get the failure probability. Huh? And the failure probability we need because it's a part of this objective function. And Hoche. Works? Yes. Very good. So the result, the result should look like this. Maybe you pay two minutes of attention. I can introduce the result to you. So here we have the decision variable and the red line, that's the expected cost that is somehow matching to this choice of the section modulus. We see if we have a section modulus, if we choose a section modulus in this domain then the expected cost is high. If we choose one in this domain the costs are also high. Yeah, that we can clear later. I think it's because of 40 there. Ah, okay. Okay, so this is one parameter, this is different here. So if you have 20 then you get a slightly different result. But once you have coded it then you get something like this. Sorry for that. It was obviously too late. So maybe we agree on 40. I will change this also in the script. But this is just one parameter you have to change. So what we see here when you did not have such a curve before, we see different domains depending on how we choose W, how we choose our design. And this side is dominated by the risk and this side is dominated by the cost of additional material. So if we choose more W then we get higher costs because the material comes at the cost, the W comes at the cost. And it's a very, very typical shape of this curve that the right-hand branch is so flat because this is dominated only by the construction cost and the left side is rather steep because this is dominated by the risk. And when we want to be in the minimum then we are here. So here you see indicated the light lines. This is the risk part of the objective function. So this is the expected failure cost and this is the construction cost part. And the total cost curve is just coming from the risk side going smoothly towards the construction cost side. So this is an optimal design we can obtain. Note that as Dany mentioned this is now 40 instead of 20 but this is just one number you have to change. Otherwise I believe the numbers are consistent. What we get as a cost that will be interesting now in the further procedure of this task the cost is somehow specified as 133,940 Norwegian kroner. So that's the minimal cost we can obtain. This is the absolute minimum we can get. And what we also get is an optimal better index and the optimal failure probability and as we have given the load effect as a maximum of a 50 year period also the failure probability and the better index is associated to this 50 year reference period. And this is of course now a value we can discuss. Normally when we don't do a risk based design whether we do a reliability based design we only want to attain a design that satisfies a certain reliability criteria. In this example we let this open and the reliability or the failure probability comes just as a site information from our optimization. But of course what we always should do we should reflect this number whether it's in a domain of something that we are used to. So if this would be an extremely low number in terms of the better index or very high failure probability compared of what we are normally doing then we should critically assess the boundary conditions whether we did address the consequences correctly. But a full risk based optimization is also we have to make a lot of assumptions is the most consistent decision support we can get for structural design. Because it only depends not only only depends on the functional relationship between the decision variable, the design variable and the failure probability it actually only depends on the derivative of it. It only depends on the gradient how we can change the failure probability by changing the design variable. And that makes this analysis very strong and very insensible against some cross errors we can do. For instance we can neglect cross human error in design and as long as we argue that this cross human error the probability of failure due to cross human error cannot be controlled sufficiently good by a marginal change in the decision variable and this is maybe an assumption which is somehow valid. Then this is totally insensitive to the fact that we did not consider this because it's only somehow evaluating our marginal change of failure probability by marginal change of the design variable. So now you can work another 5 minutes in order to reach this and then we continue to task 2. So if you have some specific question I will go around and try to answer them. So just another 5 to 10 minutes to come to this point and then we continue and look how additional data might affect the result. Maybe we can compare the same simple coding. I have a question. Well, now my computer is connected. You can have a look. I just played around and looked that I could get a nice curve. I didn't have enough data. It always looks like this. And it's not that bad. It's not bad at all. Well, if you think that there are some issues that you can't solve, then you shouldn't wait for it to work. Well, the problem is that you never know how far you are. Of course. If I don't wait for it to work... Well, I can also discuss it. I think... You're going too far. Yes, yes. It's interesting that you're talking. But I think if you look at a decision situation, it's always rational to go a bit further. But the problem is that we have seen thousands or millions at the same time. And that we don't even know how far we're going to go. For example, if you look at an assessment of an existing structure, we have the problem that the first one is steeper. It costs more to make it safer. And then we don't have limited resources. Then it's going to be more current. Yes. Yes. The cost of steel? You don't use it because you will use it later? Or because it's intrinsic? The cost of steel? You don't use it because it's hard to stay indirect? Yes, yes. I've made this up. Here is the yield strength of steel. Pardon? The R, the yield strength of steel. But it should be in newtons by millimeter square. Square, yes. That's the printing room. So that's where R should be. So it's 40 megapascals. It should be R. The standard deviation is 40 megapascals. The standard deviation is 400 megapascals. Another printing error I'm sorry for this is this Newton plus gram millimeter. It is megapascals. So folks, listen. There will be a lunch break at 12 o'clock. And you are very welcome to come directly after you have eaten something and work further on this example. But before that, I want to spend the last 10 minutes to introduce to task number two. Task number two, as you remember, is how does this optimization change when we have additional data, when we have additional observations on the yield strength of the steel, right? And that means that we have to formulate our probabilistic model about the steel yield strength in order that it somehow can accommodate for new information. So far we looked at steel strength as a normal distributed variable with a mean value of 400 megapascals and the standard deviation of 40 megapascals, right? So now when we develop this example further, we consider this property of the steel, this distribution of the steel as the property of the cross supply of steel. That's actually what is generally done. So this is the property of a steel. It somehow maps your uncertainty about the steel strength when you know that it's just steel of a certain grade that comes from the market. So it's coming from the cross supply of steel. So then we look at a probability density function of the steel yield capacity. We call it R in this example. That might look like this, right? Normal distributed. So now we consider that actually the steel property when it comes from a certain producer has a much less variability. And that's actually what you observe also in reality. So when we analyze the different batches that come from different producers, we realize that in each batch we have much less variability than when we look at the cross supply. And that might look when we want to express it in terms of probability density functions. That might look like this. Do you agree? So the probability density function of a certain batch that we get from a certain producer is much narrower than the probability distribution of the cross supply. So now we have always in decision making we have to map our state of knowledge into our probabilistic models. And if our state of knowledge is that we take any steel that is available on the market and we want to express our uncertainty about the steel property, we have to use the probability distribution of the cross supply. But we have a chance to learn more about the properties of the individual batch we are looking at because we get in one point in time we get delivered all the steel from one batch on our construction site. So we have the possibility to learn more about the probability distribution of this particular batch by doing additional tests. So actually the situation is for our beam example that we are in either of these distributions but we don't know in which that's what happens. We just don't know which because we did not specify. We did not look. We just say we want to have steel from the market. And now for using this new information we can actually learn more about and we can know better to which of these sub-populations our steel is coming from. And that we do by considering this additional data so we can have these observations and then we can update the black line which is the distribution of the cross supply by accommodating for this information. And what we use in this example is we consider a normal distribution with a known with known standard deviation and uncertain mean or unknown mean. And that's exactly what is more or less illustrated by these red lines. So we know that a typical batch when we know from which batch we are talking about a typical batch has a variability but we don't know where is the mean value. So we see that these different batches all have different mean values but they are relatively stable when it comes to the standard deviation. And then we can actually do some Bayesian updating and in the end of the document I distributed you have some general formulations for Bayesian updating but for this case, for this special case of a normal distribution with a known sigma with a known standard deviation very, very compact analytical solutions for this Bayesian updating which we now utilize for our indicative example. So actually for introducing that I swapped to the document I distributed and you are welcome to have a look on it after the lunch break. So this is the curve and now we go design after additional tests. That's what we are doing. So if you look here on the slide the idea of having this single batch and this hierarchical organization of uncertainty in steel strength is described in this text and what we now assume is that the standard deviation of a batch which we supposed to know is 20 megapascal and now the parameters we had before in our example, somehow representing representing the cross supply was 400 in mean and 40 in standard deviation and now in order to be consistent with this model here and with this new information that a batch has a 20 megapascal of standard deviation we can calculate what is the standard deviation of the mean because the mean value we consider now as being normal distributed with a mean value which is mu prime and the standard deviation which is sigma prime. So we have the red curves with a constant standard deviation of 20 megapascal but we are not sure about the mean and the mean value follows also a normal distribution with a mean value of mu prime and the standard deviation of sigma prime. So it's this with a constant standard deviation distribution with an uncertain mean we are not certain where we are. And in order to be consistent with the model we had before we can specify that the mean value of the mean is of course the same value than we had before. It's the 400 megapascal, it's the mean of the mean but the standard deviation of the mean we can calculate as I said in order to be consistent with the values we used before to be 34.64. So that's the standard deviation of the mean that's this value here. And then we can incorporate this new information and this new information that is enclosed to the data and that is used and updating actually only refers or is translated into the number of observations so this is one piece of information we use from this data the number of observations and the mean value of these observations. Only these two pieces of information we use. So you have the data you have the five observations and we somehow catalyze this in only the number of observations and the mean value of the observations. So why don't we consider the standard deviation of the observations? Exactly. Say it louder. It's already known. It's assumed to be known. So it makes no sense. So we assume to know the standard deviation we don't have to evaluate it even because we assume to know it. Of course when we are critical we would do it and then maybe we would be a little bit cautious when we would see that it's totally different of our known assumption. But in this principle when we are in this framework and we assume that we know the standard deviation the information of the new data comes only with the number of observations and the mean value. And that's interesting because it's not so much information from this additional data, right? Okay so how do we incorporate this new information here? This n equal to 5 and the x bar equal to 394.2 So these are incorporated by these standard solutions we have for this special case of a normal distribution with a mean with a known standard deviation and unknown mean. So we introduce first n prime and this can be translated in the information weight of our prior and this n prime is simply the square root of the standard deviation of a single batch divided by the standard deviation of my prior mean value. So this is actually when you remember the numbers it's 20 divided by 36.0, right? And that gets the number of 0.5774 and that's n prime and that can be as I said the weight of the prior distribution and to get a feeling in your fingertips you can even say the information I have the prior information I have does correspond to n prime number of observations. So the information I have prior is actually very very weak it contains not much information it corresponds to less than one observation. So it's in a way very non-informative and this always already gives us an idea that the information weight of the new information which is 5 will have a strong effect in the updating. So n prime is an informative value for the information weight of your prior information and then you can get the posterior parameters of the mean value of r and r itself so you remember the mean value of r was uncertain and represented by a normal distributed random variable with a mean value in the standard deviation mu prime and sigma prime and now we can incorporate the new information and we come to a mu 2 prime and the sigma 2 prime and these are then the posterior parameters that already take into account this information. So we go from mu prime and sigma prime that is incorporated here we go to mu 2 prime and sigma 2 prime and we use this as standard solutions for this case of the normal distribution with a known standard deviation this is actually a very convenient result the formula looks a little bit tricky to you but compared what you find else or compared of that kind of integrals you have to solve we will look later later in this course how complicated this can get but this is a very very nice and convenient solution that stems of course on this very simplifying assumptions so we can get the posterior parameters of the mean value and correspondingly we can get the posterior parameter of the material property itself so we have mean value conditional on the observations and we have a representation of the physical variable the yield, steel capacity conditional on the observations and this is just now the normal distribution with the mean value that is evaluated here and the standard deviation that is evaluated here this gives new values so we have we actually use this and this and when you have succeeded with the first task you already have your your program your file, your M file or your function that calculates this you save this to another name and you just change the parameters to these two of R and of course if you are interested you also incorporate this simple Bayesian updating with the formulas and with the data then it makes it a little bit more generic and then we should come to a result, yes? Is it with the ratios or with the standard deviation ratio? Because the value you give is obtained if you do the standard deviation ratio Ok so maybe I did a mistake so it is the variance ratio If you do these variances you are doing there ok If you do sigma over sigma then it is done I have to check but then you get this kind of result so you have the gray you have the gray curve that was the old result that was the old optimum and now we get which is the new result and what we see is that we have to use less W because the condition of what we learned about the structure that is not surprising because we reduced the uncertainty and also the corresponding failure probability and the better index the failure probability is actually going down which can also be explained that we learned more about the structure and as we have learned more about the structure it is also possible to find expected cost that is lower than before right so by learning more about the structure by having this additional test the minimum expected costs is getting lower yes that bitter value could have easily gone up depending on the kind of result that we get that beta value could have easily gone up depending upon the observations that we make in that case our posterior cost whatever we call them the better value goes up just go up it goes up the probability of failure could easily go up due to the observations you could think about when you make suddenly observations here but in average that is what we look later on for the preposteriori in average it will go information does help in average information does not harm that is maybe a general grandfather statement but of course you can have certain types of information that somehow indicate that you are more or less on the far side of prior distribution and then of course the cost can also go up but it is a little bit about the average tendency the spread reduces when you have more information and then you have less uncertainty spread always reduces it is only dependent whether your location is still stable you can have the situation that your variability is reducing but your location is moving so much to the weak side that actually your failure probability goes up that is possible usually go down is it because of the way we are sampling because let's say if the instrument was biased it had some bias so there would be a very significant shift in the center tendency of the observations that we get and in that case it could be negative if you don't know the bias so do you consider to know the bias or don't you know the bias if you know the bias you can take this into account but if you don't know the bias then you should at least consider this as a part of your uncertainty uncertainty always having part of this random scatter and also the unknown systematic error we are doing but any questions so far so otherwise we can go for lunch and you can work further on this afterwards to clarify something with this weight that comes in the third part so now we take this experiment for granted and we check what is the effect of this experiment and we see that these experiments already have an effect on the expected cost to make the expected cost slower because we have less uncertainty and now the next step will be that we put some costs what is the cost of each experiment and then we can actually find out what experiments we can do that's what we do after lunch good lunch good if you have some specific questions that might help to implement these two tasks you might raise your hand I can combine okay I see that you somehow work on your own and doesn't do not have so many questions so maybe we just go further I discuss a little bit with you these results you are intended to also get with a little bit more time and then we go further and we do the step to the pre-posterior analysis but here this is the posterior analysis so the gray cycle indicates the optimum as we have it identified based on the prior information on the yield strength we have got five additional observations on the yield strength and we get so called conditional optimum conditional on this data and as we see the choice of W goes down but at the same time the reliability goes up so actually what we do is we find an optimum that is a little bit smaller section modulus but at the same time this smaller section modulus does give us a higher reliability and that points to the fact that the reliability we calculate is entirely conditional on our information we have alright so it's actually expressing our belief about likelihood of failure but also and that's important when we want to bring it down to later on what we also see is that we have a slightly different minimum expected cost so the minimum expected cost given the data is 222 1239 Norwegian krona before it was 223 914 1000 so the price went down and now in the retro perspective we can already see whether this difference here the price difference is somehow in correspondence with what we have invested into this additional results how costly was it to obtain this additional data but of course afterwards we can only say it was worthwhile or not but we already have invested in the data we have used the data for our analysis and it's just informative to see whether this was efficient or not what we can now do in the pre-posterior analysis is we can analyze beforehand what the expected effect of new observations will be alright okay ladies and gentlemen let's stop here let's stop close half your computer and pay attention so we now continue closing up this example I think I hope you are all in a good way to come towards this result but now let's introduce the last step of a formal decision analysis and that would be not the decision but the right thing to do in terms of physical change of the system like changing the W of the beam now we formulate the decision on what should I know or what is optimal to be known and as we can say in principle information never hurts so when information comes at no cost always good to have more information but normally the information comes at the cost and we can actually formulate an optimum that weights or balances the investment into more information with the outcomes of our expected consequences we have as a consequence of paying money for the experiments but also suffering from the consequences of failure and also suffering from the consequences of having a physical solution that is actually too big because we did not have enough information for finding a more sensible choice right so we can plan experiments we can actually plan how many experiments we should do and this is done by this pre-posterior analysis analysis and here the expected effect of additional experiments on the total expected benefit can be analyzed and here it's important to highlight that we look at an expected effect of this information because we have not observed this information so we can also only treat the expected effect of the information on a change of the decision so what we can do is we can look at our solutions for the posterior parameters of the physical value are the yield strengths and what we can say is that we observe that the standard deviation of the yield strength is already a function of the number of experiments independent of what we observe so when we look at this formula and this is exactly the same as we used in the posterior analysis here we see that we have N and when we increase N what happens with the standard deviation it decreases so by having more observations we can decrease the standard deviation of the yield strength that's good right and actually nothing else is contained here that could be described as an attribute of the experiments so the only attribute of the additional experiments we do is the number of the experiments in this part of the equation it looks a little bit different if we look at if we look at a posterior mean there of course we have a mean of the observations right so in the original formula when we look at the posterior mean value here it looked like this we have the sample mean that's the information content of our new data set but now we want to look what is the expected effect of a future new data set so the only thing that we can do what would the mean be what we expect the mean to be of the data set we expect this mean to be the same as our prior right and that's exactly what we do in a more complex decision analysis we use the prior information in order to get an idea what the experiments could be so here we take the prior mean we take the prior mean in order to find out what would we expect this future mean value of the experiments will be right and therefore in the formula below the new prime which is the prior mean of the mean we use this two times and then everything cancels out and we just say that the mean to prime the posterior mean is actually the same as the prior mean because that's our expectation of these new experiments so actually we can use this too now in order to make our analysis and now we want to express the functional relationship for instance of the failure probability of the beta index by increasing number of observations and this is before we go into the optimization this is what we do here so here we have the number of observations and this is the effect on the reliability index and this is the effect on the expected cost so the expected cost goes down dramatically with the number of experiments so if the experiments would come at no cost there's nothing against to argue that we should make a lot of experiments right and then we would somewhere converge to the situation where we have an exact probabilistic description of a sample of a subset of this population with a standard deviation of 20 megapascals but as the experiments come at the cost we might also use this relationship to find an optimum so this is done here in the text you can read it in your document so the optimal number of experiments can be identified by assuming a cost function for the experiments so now we want to formulate to get more experiments so what is the cost as a function of n and as we did before we might argue that we have a fixed cost setting up the experimental campaign so we might not start at zero experiment zero and one experiment is the cost of one experiment but we have to establish an infrastructure for the experiments we have a fixed cost and that's here now the experiment zero is now considered as just the number 400 kroners that's not so much as 40 euros it's just to mention the number very cheap tests and then each single experiment has the cost of 20 Norwegian kroner it's 2 euros so that's the cost of each additional test so one test will come at 420 two tests as 440 and so forth so now this component we add to our total cost as a function of n so this was what we already had here and now we just consider additional the experimental costs and then we get something like that that looks more or less like the optimization curve before but now it's not the decision about physical change of the beam it's not the decision about w it's actually the decision about n number of experiments and as we see for the given cost function and of course we can dispute what would be the cost of real experiments maybe they are much more expensive than the optimum growth in that direction but we see that with the current assumption the optimal number of experiments is 5 so when we would have 6 experiments we would get more information we would get a little bit less uncertainty but we also would have to pay 20 Norwegian krona more compared to 5 experiments and that difference always makes the solution or the decision for 6 experiments or for 7 a little bit less optimal than for 5 so now we have the optimal number of experiments for this example for the number of experiments that should not be the risk region is it? like 2 experiments because it corresponds to the internet it's quite high but you should not make the mistake to say that this is really risky this is just meaning this is just meaning that that we are a little bit less optimal so no experiments that was in this n optimization curve far up it's just this situation so we are not in terms that we risk our lives when we don't do any experiments so the scale is a little bit different but of course we see that experiments have a very very large effect especially in the beginning and that's of course totally triggered by our assumption that we have this cross supply with a relatively large variation and then we say this cross supply consists of sub supplies that have a relatively low variation that makes the prior scatter of the mean value pretty wide and that makes the value of information getting more experiments pretty high so everything is somehow connecting to each other but the idea of this example and of course if you have a nice way to program it you can also make parameter studies on the different inputs so you see you get a feeling what value of information is about when you for instance change the weight of your prior information this would be this n prime where I had this little error which is 0.33 so very low information content of the prior but if this information content of the prior is much larger then the effect of the new optimum is less and then maybe it would look entirely different and given I actually played a little bit around with the numbers and even with this very very uninformative or relatively non-informative prior where from the onset of the problem the new information should always have a big effect when we get with the cost of experiments to a rather large C0 of experiments which is the establishment of an experimental campaign in a real project this is quite a value we maybe talk about 10.000 Euro or 10.000 Euro then you come into a domain where you have to say ok it makes no sense at all to make experiments then the curve just goes up and optimum is at 0 so this gives you a feeling what is information about and what is an optimal choice and of course I calibrated now all the boundary conditions that we have an optimum at 5 which is more or less some experiments but it will be never and that's a general that also you can do when you much more experimental depending on the much more statistical side you hardly get results where your optimal number of experiments is 200 because it's the effect of new information the difference between 119 and 120 observations is very very low it's very marginally affecting your problem so the optimum value is at 5 so is it because we assume the mean value is the same for the following test results because in fact we assume and now we look at the expected effect of the experiments and the best thing we can expect from our experiments is that these experiments behave as we prior think so the mean value would be there where we think it will be from our prior knowledge so it has to be consistent with our prior expectation right and of course in reality the mean value is different but the best thing we can do before we do the experiment is that the mean value we expect the most is the mean value of the prior distribution I mean the optimum value can be found at 5 is it by chance or is it by chance it's the same at 5 by chance it's only a function of all these input variables when we change for instance the cost it might be 4 value for instance increase so this line here is triggered by the cost per experiment so when you have a larger cost per experiment then your optimum goes into that direction so we might get 4 so it's just a function that maybe you might mean it's by chance it's just a function of our input but in the idle world in a serious project we of course want to quantify the input based on our best knowledge we have and at least this decision framework is a consistent framework where we have enough interfaces where we can put information and our experience in in order to give us a rational framework for our reasoning but of course in a real project we have to discuss what is the cost of the experiment and so forth what is the prior estimate of the mean value and things like that that we perform during the lifecycle of the structure for example yeah in that case how do we incorporate interest rates it's a very good question I forgot to mention so this example is in a way a textbook example as it is somehow simplified not only in terms of how we do the Bayesian updating but it's also simplified in terms of the objective function and in the objective function when you do a serious assessment then you have to think about your total costs but you have to think about that these costs in this objective function they take place at different points in time right so you have the construction cost that obviously takes place pretty soon after you take this decision but then you have the failure costs that take place and some future point in time and now you have to somehow build net present value now because now you do the decision of the costs on the expenditures you will have in the future and that makes the problem a little bit more complicated right and when you think about an inspection problem then you also really seriously have to take into account how you can project all these costs on the point in time your decision takes place and then interest plays a big role and also the uncertainties in the assumptions of interest rates play a role and sometimes a really big role when it comes to the sensitivity to the decision yeah but this is simplified this is not discussed now in this example this would make the problem more complicated 5 inspections 5 inspections taken at an instant of time pardon what kind of inspections when we are talking about 5 observations we are talking about 5 observations taken at a single instant instant of time is it right yeah this is now the design phase and we can draw some material tests during the design and tomorrow I hope we look at maybe the same structure and we include some degradation on R and then we discuss how can we learn about this degradation function and then we maybe think also about a time sequence or something like that but the principle remains the same but the technicalities they become a little bit more complicated when we look at it over time but also by inspections we add information to the system information comes to a cost and we might find as we do here an optimum between the information that comes by a cost and the effect on our optimal solution and then of course in a practical assessment situation we maybe very often do not do that entirely risk based so maybe we want to be over a certain threshold in terms of reliability and then this gets also a little bit more different from that example so here we have an entirely risk based consideration of the entire problem so the failure probabilities as an output or outside of our problem setting they don't play any role it's about minimization of expected costs and that's it so in this case no this would be at a certain point in time you make a number of observations on your structure yeah good then I suggest you take a deep breath and tonight you of course don't go to the city tour you sit at home and look at this document and you implement an example if you did not have time for that yeah of course not here for fun yeah of course of course five minutes and then you just continue