INFERENCE

Inference is the central operation of Istar, and it is well to understand it soon after you have mastered the first steps of Istar. Inference involves a number of attributes connected by the 'inference' type of relatonship. The whole inference KB consists of a number of stages in each of which one receives the links from the others; we will call the one the central attribute and the others its antecedents.

For the central attribute you choose an inference method and for each of the 'inference' links to its antecedents you might choose a unary operator and set a weighting.

Page under construction.

Meaningful Inference Methods and Weightings

Commonly Needed Types of Inference among Probabilistic Attributes

In the ICT project we used a lot of probabilistic attributes, with many booleans that were considered probabilities with two values (0,1). We found that our KB needed certain types of inference more commonly than others and moreover that selection of inference method was closely tied with selection of unary operators on the relationships. The set comprising inference method and the unary operators of all its antecedent links seemed to fall into several categories. Other variations no doubt are possible, but the following seemed the most meaningful. All involve a probabilistic consequent and usually probabilistic or boolean antecedents. (When probabilistic antecedents are expected then booleans are accepted by Istar because it converts them automatically into two-value probabilities. Also, Bayesian or proportion antecedents are taken to be probabilities.)

Simple Picking List

Picking List: Any M from N

Belt and Braces

Weakest Link

Paranoid Weakest Link

Strongest Link

Synergistic

Evidence

In the ICT knowledge base we found Paranoid and Belt and Braces were the most often used.

Unary Operators in Istar

Page under construction.

Unary operators are applied to inference relationships to modify the effect of the antecedent attribute before using it in the inference. At present they only apply to inference relationships.

Normally a relationship starts off with no unary operator, except as required by the inference method. For instance, the Bayesian inference method requires that its links hold bayesian weights, so in this case the indicated unary operator is overridden.

List of Unary Operations

The effect of most unary operators is given below, but there are two exceptions that override those.

The highest priority is given to the CONTROL unary operator. If one of these is found, and the antecedent is such that it can be converted into a truth value (i.e. of types Boolean, Probability, Proportion, Bayesian, Odds) then it might set the value of the consequent regardless of the other antecedents; see below. If it is not one of these types then the CONTROL is ignored.

The next highest priority is when the inference method of the consequent is Bayesian Accumulation of evidence. Then the operation is different. See below.

Otherwise, the operations are as follows:

Direct Unary Op: esUO_NONE

No change (except when bayesian inference method.

Negate: esUO_NEG

Except when bayesian inference method:

Invert: esUO_INVERT

Except when bayesian inference method:

Absolute Value: esUO_ABS

Except when bayesian inference method:

Multiply (Scale) by Weight: esUO_SCALE

Except when bayesian inference method:

Divide (Shrink) by Weight: esUO_DIV

Except when bayesian inference method:

Add Weight: esUO_ADD

Except when bayesian inference method:

Subtract Weight: esUO_SUB

Except when bayesian inference method:

Take Proportion, Probabilistic And: esUO_PROPN, esUO_PROBAND

Except when bayesian inference method:

Probabilistic Or: esUO_PROBOR

Except when bayesian inference method:

Mask by Weight; Bitwise And: esUO_AND

Except when bayesian inference method:

Union with Weight; Bitwise Or: esUO_OR

Except when bayesian inference method:

Bitwise Exclusive Or: esUO_XOR

Except when bayesian inference method:

Randomize: esUO_RANDOM

Except when bayesian inference method:

Control: esUO_CONTROL

If the antecedent is of the appropriate type, one that can be converted to a truth value, then this unary operator takes precedence over all others. It is normally when one attribute is made irrelevant by another (such as "Are you ill?" would make "What illness do you have?" irrelevant if answered with 'No'). It acts to control whether the consequent is relevant or not, by taking the truth value of the antecedent and:

When Inference Method is Bayesian Accumulation: esUO_WEIGHT, esUO_INVWEIGHT

When the inference method is Bayesian Accumulation of Evidence, then special action is taken which overrides the above. The unary operator on the relationship is replaced by one of these: INVWEIGHT being used if the unary operator is NEGATE or INVERT, and the WEIGHT being used otherwise. With these two unary operators:


Inference Methods

This is a reference guide to the types of inference methods available in the 'es' module of IRKit, as used in KBTools/Istar. Each method is known by a short identifier of the for esIM_XXX where XXX is its name. The prefix, esIM, means 'es' module Inference Method, and these names are those found in the program (e.g. in the es.h include file).

For each method we give the following information:

esIM_ADD, esIM_SUB
"X = A + B, C, ...", "X = A - B, C, ..."

Action: With integers and floating point numbers these perform simple addition and subtraction. The first antecedent is taken (converted to integer or floating point as needed), and then all the others are added to or subtracted from it, accumulating a result as we take each antecedent. For simple use, ensure that all antecedents are integer or float.

Antecedents: These act on numeric antecedents.

Consequents: Integer, Float, Angle/Direction, Enum, Ordinal. Others in future, perhaps.

Advanced use: When B (and C etc.) is a PROPORTION the inference is different: it adds that proportion of what is already accumulated. Thus (60 + 50%) gives 90, not 110. If C, D, etc. is a PROPORTION, it takes a proportion of what is already accumulated, not just of A. Thus if A is 60, B is 50%, C is 20 and D is 10% the result is:

At present, probabilities, Bayesians, odds and ratios act as proportions do.

esIM_MULT, esIM_DIV
"X = A * B, C, ...", "X = A / B, C, ...)"

Action: A is taken and then multiplied or divided by the rest.

Stopping: With multiplication, if an antecedent makes the result zero then no further ones are taken.

Antecedents: These act on numeric antecedents.

Consequents: Integer, Float or Angle/Direction.

Advanced use: The stopping rule can be used to control the order in which questions are asked.

esIM_AND, esIM_OR
"X = A & B & C & ...," "X = A | B | C | ..."

Action: The result is the normal boolean AND or OR of all the antecedents.

Stopping: With AND, if any antecedent in order A, B, C ... is FALSE, no others are taken. With OR, if any is TRUE, no others are taken.

Antecedents: These act on boolean antecedents. Any other type is converted to boolean if possible before being accumulated into the result.

Consequents: Boolean.

Advanced use: The stopping rule can be used to control the order in which questions are asked.

esIM_NOT
"X = !(A)"

Action: Gives the NOT of the antecedent.

Antecedents: This acts on a single boolean antecedent, and ignores all others.

Consequents:

Advanced use:

esIM_PROBAND, esIM_PROBOR, esIM_PROBNOT
"p(X) = p(A) & p(B) &...", "p(X) = p(A) | p(B) |...", "p(X) = 1 - p(A)"

Action: They give, respectively, the probabilistic AND, OR and NOT.

Antecedents: These act on probabilistic antecedents. Proportions are treated as probabilities. Bayesians have their main part treated as a probability. Booleans are converted to probability. Odds are converted to probability in the normal manner, viz. P = O / (1 + O).

Consequents:

Advanced use:

Bayesian esIM_BAYES

Action: A very useful inference for decision support systems, this performs a Bayesian accumulation of beliefs of evidence to come to a level of belief in a conclusion. That is, the consequent and antecedents are all levels of belief in various propositions. e.g. (Antecedent belief that) the bird has a red breast and (antecedent belief that) the bird is small might be evidence for (consequent belief that) the bird is a (British) robin, and (antecedent belief that) the bird has a thick bill would be evidence against. (For 'belief' you can also say 'probability'.) This form of inference is found in artificial intelligence.

Stopping: Normally there is no stopping rule. But you can define a Lower or Upper Cut-Off to ignore any weak evidence once you are sufficiently confident in the present result. Suppose you have six antecedents and a Lower Cut-Off of 10% on the consequent, and that three of the antecedents have been answered in such a way as to bring the belief in the consequent down to 5%. Then if the other three (unanswered) antecedents have sufficiently weak evidence that however they are answered their combined effect will not bring the final result over 10%, then the consequent is considered answered. So the three remaining antecedents are not searched during the backward chaining process. Conversely for the Upper Cut-Off.

Antecedents: This acts on Bayesian antecedents. Probabilities, proportions and booleans are converted to Bayesian whose a-priori is 0.5 (50%).

Consequents: Bayesian.

Advanced use: Using the Lower and Upper Cut-Offs you can make the knowledge base appear more 'intelligent' and less pedantic. To understand Bayesian accumulation of evidence, read the following. The consequent belief is an accumulation of the antecedent beliefs, for and against. Each antecedent can have a different weight, so that having a red breast is of greater weight (more conclusive) as evidence for the bird being a robin than that the bird is small. Evidence against (such as thick bill) is also indicated by the weights, and in this case the weight would be inverted. The weights are held as parameters of the relationship that joins the antecedent to the consequent. All antecedent relationships must have a UOp of either 'Normal' or 'Negate', and are expected to hold a Bayesian Weight, which is two odds multipliers - four small positive integers in all. One pair should give a ratio >= 1 and the other pair should give a ratio <= 1. The distance these ratios are from 1 the 'stronger' the weight for this antecedent. If belief in the antecedent is total (e.g. 100%) then the full weight found in the relationship is taken and accumulated into the consequent belief. But if the belief is partial then only part of the weight is taken. By "total" we mean either that the antecedent is definitely known to be true (100%) or definitely known to be false (0%). The consequent and each antecedent has an a-priori belief, which is the belief which would be taken if there were no evidence. (The a-priori is often found from the statistical probability of the proposition being true.) The a-priori belief of the consequent is the starting point for accumulation. e.g. The a-priori belief that the bird is a robin might be 10%, and as evidence is accumulated for or against the belief varies from this level. When the proposition is an antecedent of a Bayesian inference then the a-priori is also used to calculate partial weights. If the belief is precisely that of the a-priori then the antecedent has zero weight, no effect. As the belief moves away from the a-priori of the antecedent the amount of the weight taken increases until the whole is taken for a total belief.

esIM_EQ, esIM_NE
"Whether A = all", "Whether A <> all"

Action: These can take most types of antecedent, and yields a boolean result. All antecedents after the first, viz. B, C, D, ..., are converted to the type of the first before the comparison. The result is TRUE is A equals all the rest, is unequal to all the rest, respectively.

Stopping: Answered as soon as it is known the result is false, so no further antecedents will be searched during backward chaining.

Antecedents: A: Any. Others: Any convertible to type of A.

Consequents: Boolean.

Advanced use: Owing to the stopping rule, this can be used to control the order in which questions are asked of the user.

esIM_GT, esIM_LT, esIM_GE, esIM_LE
"Whether A > all", "Whether A < all", "Whether A >= all", "Whether A <= all"

Action: These all perform comparisons in a similar manner to the above. The difference is that the antecedents must by numeric or string.

Antecedents: A: Any numeric or ordinal. Others: Any convertible to type of A.

Consequents: Boolean.

Advanced use:

esIM_PEQ, esIM_PGT, esIM_PLT, esIM_PNE, esIM_PGE, esIM_PLE
"% A =", "% A >", "% A <", "% A <>", "% A >=", "% A <="

Action: These perform comparisons similar to the above, but they find the proportion for which the comparison is true, rather than whether all are true.

Antecedents: A: Any numeric or ordinal. Others: Any convertible to type of A.

Consequents: The result is a Proportion (or Probability or Bayesian).

Advanced use:, esIM_CEQ, esIM_CGT, esIM_CLT, esIM_CNE, esIM_CGE, esIM_CLE
"Count A =", "Count A >", "Count A <", "Count A <>", "Count A >=", "Count A <=" Action: These perform comparisons similar to the above, but count the number for which the comparison is true.

Antecedents: A: Any numeric or ordinal. Others: Any convertible to type of A.

Consequents: Integer.

Advanced use:

esIM_ISIN, esIM_CISIN, esIM_PISIN
"A is found in all B, C, ...", "How many A is in", "% A is in"

Action: These look to see if A 'is in' all the other antecedents, and return either a truth value, a number or a proportion (as in the comparisons above). By 'is in' we mean one of two things. If all antecedents are strings, then is looks to see if A is a substring of all other antecedents. If all antecedents are integers, it looks to see if A is a factor of all the others.

Antecedents: A: String or integer. Others: Must be like A or convertible to A's type.

Consequents: esIM_HAS: Boolean. esIM_CHAS: Integer. esIM_PHAS: Proportion, Probability or Bayesian.

Advanced use:

esIM_HAS, esIM_CHAS, esIM_PHAS
"A contains all B, C, ...", "How many are in A", "% in A"

Action: These operate inversely to the above. They count or find the proportion of antecedents after the first (A), that are 'in' A in the sense defined above. That is, if strings, whether each is a substring of A, and if integers, if each is a factor of A.

Antecedents: A: String or integer. Others: Must be like A or convertible to A's type.

Consequents: esIM_HAS: Boolean. esIM_CHAS: Integer. esIM_PHAS: Proportion, Probability or Bayesian.

Advanced use:

esIM_FIRSTKNOWN
"First Known"

Action: This finds the first antecedent that has a known value. It is useful for instance in allowing the user to answer 'Unknown' and then inferring the value by other means. It can take any type of antecedent that is convertible to the type of the consequent.

Antecedents: Any that can be converted to type of consequent.

Consequents: Any.

Advanced use: With this you can provide sophisticated strategies of questioning the user or otherwise finding out information.

esIM_CHOICE
"Chooser"

Action: This acts like an array or small database. It chooses one antecedent. If A is integer, it chooses the Ath among the rest. That is, if A is 1 it chooses B, if 2, it chooses C, etc. If 0, it returns Unknown. If A is boolean, it chooses B if A is false, and C if A is true.

Antecedents: A: Anything that can be converted to integer. Others: Converted to type of consequent.

Consequents: Any.

Advanced use: Note that in backward chaining, it first gets A answered and once its value is found will only backward chain up the appropriate chosen antecedent. In this way you can cut out whole sections of questioning if you wish.

esIM_ALLANS
"All Answered"

Action: This returns TRUE or FALSE, depending on whether all antecedents are in an answered state. They can be of any type.

Antecedents: Any.

Consequents: Boolean.

Advanced use:

esIM_COUNTANS
"How many Answered"

Action: This counts the number of antecedents that are answered. They can be of any type.

Antecedents: Any.

Consequents: Integer.

Advanced use: Beware: The consequent is always known and answered.

esIM_COUNTKNOWN
"How many Known"

Action: This counts the number of antecedents that have known values. They can be of any type.

Antecedents: Any.

Consequents: Integer.

Advanced use:

esIM_COUNT
"No of Antes"

Action: This is simply a count of the antecedents. Like a constant, but you don't have to set it manually if you add another.

Antecedents: Any.

Consequents: Integer.

Advanced use:

esIM_IRAND
"X = A + (Rand * (B - A))"

Action: This produces a random number. At present, the antecedents are irrelevant. It uses the FastRand algorithm.

Antecedents Any.

Consequents: Integer.

Advanced use:

esIM_MAX, esIM_MIN
"Max", "Min"

Action: These act on numeric or string antecedents. They find which one is maximum or minimum.

Antecedents: Anything that can be converted to type of consequent.

Consequents: Numeric or string. The antecedents are converted to type of consequent.

Advanced use: These act on numeric or string antecedents. They return the maximum or minimum value.

esIM_WHICHMAX , esIM_WHICHMIN
"Which Max", "Which Min"

Action: These act on numeric or string antecedents. They find which one is maximum or minimum.

Antecedents: Most numerics and string.

Consequents: Integer, ENUM or ORDINAL (in which case the answer is 1 if A is max/min, 2 if B, and so on). Or BLOCK, in which case the result is the DSAP of the antecedent block.

Advanced use: The use of BLOCK consequent is expected to become more versatile in future, but at present you can find for instance the name of the block by conversion to string at the next stage.

esIM_AVG
"Mean"

Action: This acts on certain numeric antecedents, and returns the mean (average) of them.

Antecedents: Numeric.

Consequents: Numeric.

Advanced use:

esIM_CONCAT
"Concat"

Action: This concatenates string antecedents. e.g. "cat" and "dog" antecedents gives consequent "catdog" (note: no spaces; an option for spacing might be added in future). In future CONCAT is likely to be used for any data that is essentially a linear sequence, such as sound samples, songs, animations, lists, arrays.

Antecedents: If the antecedents are not string type then they are converted to string if possible.

Consequents: String.

Advanced use:


Copyright (c) Andrew Basden 1997. Last updated: 21 May 1999