贝叶斯软件使用指南_第1页
贝叶斯软件使用指南_第2页
贝叶斯软件使用指南_第3页
贝叶斯软件使用指南_第4页
贝叶斯软件使用指南_第5页
已阅读5页,还剩71页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、a. introduction to bayes netscopyright ? 2009 norsys software corp.1. what is a bayes net? a bayes net is a model. it reflects the states of some part of a world that is being modeled and it describes how those states are related by probabilities. the model might be of your house, or your car, your

2、body, your community, an ecosystem, a stock-market, etc. absolutely anything can be modeled by a bayes net. all the possible states of the model represent all the possible worlds that can exist, that is, all the possible ways that the parts or states can be configured. the car engine can be running

3、normally or giving trouble. it's tires can be inflated or flat. your body can be sick or healthy, and so on. so where do the probabilities come in? well, typically some states will tend to occur more frequently when other states are present. thus, if you are sick, the chances of a runny nose are

4、 higher. if it is cloudy, the chances of rain are higher, and so on. here is a simple bayes net that illustrates these concepts. in this simple world, let us say the weather can have three states: sunny, cloudy, or rainy, also that the grass can be wet or dry, and that the sprinkler can be on or off

5、. now there are some causal links in this world. if it is rainy, then it will make the grass wet directly. but if it is sunny for a long time, that too can make the grass wet, indirectly, by causing us to turn on the sprinkler. when actual probabilities are entered into this net that reflect the rea

6、lity of real weather, lawn, and sprinkler-use-behavior, such a net can be made to answer a number of useful questions, like, "if the lawn is wet, what are the chances it was caused by rain or by the sprinkler", and "if the chance of rain increases, how does that affect my having to bu

7、dget time for watering the lawn". here is another simple bayes net called asia. it is an example which is popular for introducing bayes nets and is from lauritzen&spiegelhalter88. note, it is for example purposes only, and should not be used for real decision making.it is a simplified versi

8、on of a network that could be used to diagnose patients arriving at a clinic. each node in the network corresponds to some condition of the patient, for example, "visit to asia" indicates whether the patient recently visited asia. the arrows (also called links) between any two nodes indica

9、te that there are probability relationships that are know to exist between the states of those two nodes. thus, smoking increases the chances of getting lung cancer and of getting bronchitis. both lung cancer and bronchitis increase the chances of getting dyspnea (shortness of breath). both lung can

10、cer and tuberculosis, but not usually bronchitis, can cause an abnormal lung x-ray. and so on. the direction of the link arrows roughly corresponds to "causality". that is the nodes higher up in the diagram tend to influence those below rather than, or, at least, more so than the other way

11、 around. in a bayes net, the links may form loops, but they may not form cycles. this is not an expressive limitation; it does not limit the modeling power of these nets. it only means we must be more careful in building our nets. in the left diagram below, there are numerous loops. these are fine.

12、in the right diagram, the addition of the link from d to b creates a cycle, which is not permitted.  a valid bayes net not a bayes netthe key advantage of not allowing cycles it that it makes possible very fast update algorithms, since there is no way for probabilistic influence to "c

13、ycle around" indefinitely.to diagnose a patient, values could be entered for some of nodes when they are known. this would allow us to re-calculate the probabilities for all the other nodes. thus if we take a chest x-ray and the x-ray is abnormal, then the chances of the patient having tb or lu

14、ng-cancer rise. if we further learn that our patient visited asia, then the chances that they have tuberculosis would rise further, and of lung-cancer would drop (since the x-ray is now better explained by the presence of tb than of lung-cancer). we will see how this is done in a later section. summ

15、ary in this section we learned that a bayesian network is a model, one that represents the possible states of a world. we also learned that a bayes net possesses probability relationships between some of the states of the world.1.1. why are bayes nets useful? 1.1.1 modeling reality a model is genera

16、lly useful if it helps us to greater understand the world we are modeling, and if it allows us to make useful predictions about how the world will behave. it is often easier to experiment with the model as compared to reality. in the past, when scientists, engineers, and economists wanted to build p

17、robabilistic models of worlds, so that they could attempt to predict what was likely to happen when something else happened, they would typically try to represent what is called the "joint distribution". this is a table of all the probabilities of all the possible combinations of states in

18、 that world model. such a table can become huge, since it ends up storing one probability value for every combination of states, this is the multiplication of all the numbers of states for each node. in the weather model above, this would be 3 x 2 x 2 = 12 probabilities. in the asia model it would b

19、e 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 = 28 = 256 probabilities. for models of any reasonable complexity, the joint distribution can end up with millions, trillions, or unbelievably many entries. clearly a better way is needed. bayesian nets are one such way. because a bayes net only relates nodes that are

20、 probabilistically related by some sort of causal dependency, an enormous saving of computation can result. there is no need to store all possible configurations of states, all possible worlds, if you will. all that is needed to store and work with is all possible combinations of states between sets

21、 of related parent and child nodes (families of nodes, if you will). this makes for a great saving of table space and computation. (of course, some models are still too large for today's bayes net algorithms. but new algorithms are being developed and breakthroughs are promising. this is a hotly

22、 researched area of modern computer science.) a second reason bayesian nets are proving so useful is that they are so adaptable. you can start them off small, with limited knowledge about a domain, and grow them as you acquire new knowledge. furthermore, when you go to apply them, you don't need

23、 complete knowledge about the instance of the world you are applying it to. you can use as much knowledge as is available and the net will do as good a job as is possible with the available knowledge. to illustrate this, let us return to our asia net, that we saw in section 1 above. let us suppose t

24、hat you are a newly graduated medical doctor in los angeles, a specialist in lung diseases, and you decide to set up a chest clinic, one that handles serious lung-related disease. from your text-book studies you know something about the rates of lung cancer, tuberculosis, and bronchitis, and their c

25、auses and symptoms, so you can setup a basic bayes net with some of that theoretical knowledge. for example, let's say according to your textbooks: · 30% of the us population smokes. · lung cancer can be found in about 70 people per 100,000. · tb occurs in about 10 people per 100,

26、000. · bronchitis can be found in about 800 people per 100,000. · dyspnea can be found in about 10% of people, but most of that is due to asthma and causes other than tb, lung cancer, or bronchitis. armed with these statistics you could set up the following bayes net: unfortunately, this n

27、et is not very helpful to you, because it really doesn't reflect the population of people that seek help from your clinic. most of them have been referred by their family physicians, and so the incidences of lung disease amongst that population is much higher, you would imagine. so you really sh

28、ould not use the above bayes net in your practice. you need more data. as your clinic grows and you handle hundreds of patient cases, you learn that while the text books may have described the north american situation, the reality of your clinic and its population of patients is very different. this

29、 is what your data collection efforts reveal:· 50% of your patients smoke. · 1% have tb. · 5.5% have lung cancer. · 45% have some form of mild or chronic bronchitis. you enter these new figures into your net, and now you have a practical bayes net, one that really describes the k

30、ind of patient you typically deal with. so, let us see how we would use this net in our daily medical practice. the first thing we should note is that the above net describes a new patient, one whom has just been referred to us, and for whom we have no knowledge whatsoever, other than that they are

31、from our target population. as we acquire knowledge specific to each particular patient, the probabilities in the net will automatically adjust. this is the great beauty and power of bayesian inference in action. and the great strength of the bayes net approach is that the probabilities that result

32、at each stage of knowlege buildup are mathematically and scientifically sound. in other words, given whatever knowledge we have about our patient, then based on the best mathematical and statistical knowledge to date, the net will tell us what we can legitimately conclude. this is a very powerful to

33、ol, indeed. take a moment to think on it. you as a doctor are not just relying on hunches, or an intuitive sense of the likelihood of illness, as you may have in the past, but, rather, on a scientifically and provably accurate estimate of the likelihood of illness, one that gets more and more accura

34、te as you gain knowledge about the particular patient, or about the particular population that the patient comes from. so, let us see how adding knowledge about a particular patient adjusts the probabilities. let us say a woman walks in, a new patient, and we begin talking to her. she tells us that

35、she is often short of breath (dyspnea). so, we enter that finding into our net. with netica we shall see, this is as simple as pointing your mouse at a node and clicking on it once, whereupon a list of available states pops up, and you then click on the correct item in the list. after doing that, th

36、is is what the net looks like. notice how the dyspnea box is grayed, indicating that we have evidence for it being in one of its states. in this case, because our patient appears trustworthy, we say we are 100% certain that our patient has dyspnea. it is easy with netica to enter an uncertain findin

37、g (also called a likelihood finding), say of 90% present, but let's keep things simple for now.observe how with this new finding, that our patient has dyspnea, that the probabilities for all three illnesses has increased. why is this? well, since all those illnesses have dyspnea as a symptom, be

38、cause our patient is indeed exhibiting this symptom, it only makes sense that our belief in the possible presence of those illnesses should increase. basically, the presence of the symptom has increased our belief that she might be seriously ill. let's look at those inferences more closely. 1. t

39、he most significant jump is for bronchitis, from 45% to 83.4%. why such a large jump? well, bronchitis is far more common than cancer or tb. so, once we have evidence for serious lung illness, it becomes our most likely candidate diagnosis. 2. the chances that our patient is a smoker has now increas

40、ed substantially, from 50% to 63.4%. 3. the chances that she recently visited asia has increased very slightly: from 1% to 1.03%, which is insignificant. 4. the chances of our getting an abnormal x-ray from our patient has also gone up marginally, from 11% to 16%. if you think about this expansion o

41、f our knowledge, it is truly quite helpful. we have only entered one finding, the presence of dyspnea, and this knowledge has "propagated" or spread its influence around the net, accurately updating all the other possible beliefs. some of our beliefs are increased substantially, others har

42、dly at all. and the beauty of it is that the amounts are precisely quantified. we still do not know what precisely is ailing our patient. our current best belief is that she suffers from bronchitis (probability of present=83.4%). however, we would like to increase our chances of a correct diagnosis.

43、 if we stop here and diagnose her with bronchitis and she really has cancer, we would be a poor doctor indeed. we really need more information. so, being thorough, we run through our standard check-list of questions. we ask her if she has been to asia recently. surprisingly, she answers "yes&qu

44、ot;. now, let us see how this knowledge affects the net.suddenly, the chances of tuberculosis has increased substantially, from 2% to 9%. note, interestingly, that the chances of lung cancer, bronchitis, or of our patient being a smoker all have decreased. why is this? well, this is because the expl

45、anation of dyspnea is now more strongly explained by tuberculosis than before (although bronchitis still remains the best candidate diagnosis). and because cancer and bronchitis are now less probable, so is smoking. this phenomenon is called "explaining away" in bayes net circles. it says

46、that when you have competing possible causes for some event, and the chances of one of those causes increases, the chances of the other causes must decline since they are being "explained away" by the first explanation. to continue with our example, suppose we ask more questions and find o

47、ut that our patient is indeed a smoker. here is the updated net.note that our current best hypothesis still remains that the patient is suffering from bronchitis, and not tb or lung cancer. but to be sure, we order a diagnostic x-ray be performed. let us say that the x-ray turns out normal. the resu

48、lt is:note how this more strongly confirms bronchitis and disconfirms tb or lung cancer.but suppose the x-ray were abnormal. the result is:note the big difference. tb or lung cancer has shot up enormously in probability. bronchitis is still the most probable of the three separate illnesses, but it i

49、s less than the combination hypothesis of tb or lung cancer. so, we would then decide to perform further tests, order blood tests, lung tissue biopsies, and so forth. our current bayes net does not cover those tests, but it would be easy to extend it by simply adding extra nodes as we acquire new st

50、atistics for those diagnostic procedures. and we do not need to throw away any part of the previous net. this is another powerful feature of bayes nets. they are easily extended (or reduced, simplified) to suit your changing needs and your changing knowledge. summary in this section we learned that

51、a bayesian network is a mathematically rigorous way to model a world, one which is flexible and adaptable to whatever degree of knowledge you have, and one which is computationally efficient. 1.1.2 assisting decision making it is one thing to predict reality as accurately as is possible, but a natur

52、al and extremely useful extension of this is simply to weigh the states of your model with degrees of "goodness" or "badness". that is, if some states of the world lead to pleasure, while others to pain, you simply want to find out how can you change the world to maximize the ple

53、asure and minimize the pain. of course, you can use other terms for value, other than pleasure and pain, such as money, leisure-time, increased survival, and so forth. there is a science of decision making that mixes probability with measurements of value. it is called decision theory or utility the

54、ory. bayes nets are easily extended to computing utility, given the degree of knowledge we have on a situation, and so they have become very popular in business and civic decision making as much as in scientific and economic modeling. we will see several examples of this later on in the tutorial whe

55、n we use netica for decision making. note on terminology. bayes nets that are used strictly for modeling reality are often called "belief nets", while those that also mix in an element of value and decision making, as "decision nets". of course, you can use a belief net to make d

56、ecisions, but in a true decision net, the correct decision amongst the given options is computed for you, on quantitative grounds. the net itself gives you the optimal decisions. if you choose to act differently than the net suggests, it must be because you have extra information not represented in

57、the net, or else you are in some sense not deciding rationally. this of course assumes that a rational person will want to maximize, pleasure, money, or whatever measure of value you choose, which is a question that is debated amongst philosophers. but we won't enter that arena here.one interest

58、ing application of decision nets is in robotic controllers. the robot not only computes the best action using a bayes net, but actually performs that action.1.2. why are bayes nets called bayes nets? bayes nets are networks of relationships, hence nets. and they are named "bayes" after rev

59、erend thomas bayes, 1702-1761, a british theologian and mathematician who wrote down a basic law of probability which is now called bayes rule.bayes rule: for any two events, a and b,p(b|a) = p(a|b) x p(b) / p(a)where you read 'p(a)' as "the probability of a", and'p(a|b)' a

60、s "the probability of a given that b has occurred". it turns out that bayes' rule is very powerful and is the basic computation rule that allows us to update all the probabilities in a net, when any one piece of information changes. here is an example of it. suppose you live in london, england, and you notice that during the winter, it rains 50% of the time and that it is

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论