We have introduced to [B/D] our four elements, and we have specified expectations for them, but we have yet to specify variances and covariances for them. In fact [B/D] assumes that all variance and covariance specifications are zero until informed otherwise. This we do by using the [B/D] command VAR: . Let us look at a simple example of the use of this command:
BD>var:v(1,B1,B2) = 0.72
This syntax stands for ``take the covariance between B1 and B2 in store 1 to be 0.72''. Throughout this document we will ignore the store number as it will always be 1.
In our example with four quantities we have ten such beliefs to announce: four variances and six covariances. We could enter each of these ten beliefs individually into [B/D] as in the example above, but instead we will save some effort by declaring beliefs over the entire collection at the same time. We do this as follows. The base named ``G'' can be thought of as a vector:
Here, the base ``G'' is replaced by its constituent elements, in alphabetical order. Now think of the covariance matrix over the vector G:
Now we input the lower triangle of this covariance matrix, where each row of numbers must be entered before pressing the carriage return key:
BD>var:v(1,G)
BD*1.12
BD*0.72 2.43
BD*0.62 0.30 1.12
BD*0.30 0.43 0.72 2.43
Hence, this form of the VAR: command allows us to input the lower triangle of the variance matrix for the collection defined by the name ``G'', and in so doing defines all the necessary covariances. There are other styles of introducing covariance specifications, for example we might well have introduced , , and separately.
Did you notice that the [B/D] prompt changed from BD>
to
BD*
after you typed in the first line? This is because [B/D] has
worked out that you need to input four rows of a lower triangular
matrix, and so expects strictly numerical input, where the numbers are
separated by at least one space. You should type in a complete row of
numbers before ending the line by typing a carriage return. The prompt
will revert to the standard prompt, BD>
, as soon as the numerical
input is complete. ([B/D] uses different prompts to indicate the kind of
input that it expects and its type of environment.)
We can check our specifications by issuing the command
BD>look:(v1)
Figure 7: Covariance definitions
giving the output shown in figure 7, which lists the belief specifications for all elements so far defined. The number that you specified for in the first simple example of the VAR: command that you typed in has been overwritten; if you notice any mistakes, you can correct them piecemeal by using this single-entry syntax.
By replacing the v1 argument by the r1 argument, we get to see the correlation matrix for our quantities of interest, rather than the covariance matrix. The output shown in figure 8 is obtained by issuing the command:
BD>look:(r1)