<< Chapter < Page | Chapter >> Page > |
Cautionary notes
The program mincalc depends upon the provision in MATLAB for solving equations when less than full data are available (based on the singular valuedecomposition). There are several situations which should be dealt with as special cases. It is usually a good idea to check results by hand to determinewhether they are consistent with data. The checking by hand is usually much easier than obtaining the solution unaided, so that use of MATLAB is advantageous evenin questionable cases.
MATLAB Solutions for examples using mincalc
% file mcalc01 Data for software survey
minvec3;DV = [A|Ac; A; B; C; A&B&C; Ac&Bc; (A&B)|(A&C)|(B&C); (A&Bc&C) - 2*(Ac&B&C)];DP = [1 0.8 0.65 0.3 0.1 0.05 0.65 0];TV = [(A&B&Cc)|(A&Bc&C)|(Ac&B&C); Ac&Bc&C];disp('Call for mincalc')>>mcalc01 % Call for data
Call for mincalc % Prompt supplied in the data file>>mincalc
Data vectors are linearly independentComputable target probabilities
1.0000 0.55002.0000 0.0500
The number of minterms is 8The number of available minterms is 8
Available minterm probabilities are in vector pmaTo view available minterm probabilities, call for PMA>>disp(PMA) % Optional call for minterm probabilities
0 01.0000 0.0500
2.0000 0.10003.0000 0.0500
4.0000 0.20005.0000 0.1000
6.0000 0.40007.0000 0.1000
% file mcalc02.m Data for computer survey
minvec3DV = [A|Ac; A; B; C; A&B&C; A&C; (A&B)|(A&C)|(B&C); ...
2*(B&C) - (A&C)];DP = 0.001*[1000 565 515 151 51 124 212 0]; TV = [A|B|C; Ac&Bc&C];disp('Call for mincalc')>>mcalc02
Call for mincalc>>mincalc
Data vectors are linearly independentComputable target probabilities
1.0000 0.96802.0000 0.0160
The number of minterms is 8The number of available minterms is 8
Available minterm probabilities are in vector pmaTo view available minterm probabilities, call for PMA>>disp(PMA)
0 0.03201.0000 0.0160
2.0000 0.37603.0000 0.0110
4.0000 0.36405.0000 0.0730
6.0000 0.07707.0000 0.0510
% file mcalc03.m Data for opinion survey
minvec4DV = [A|Ac; A; B; C; D; A&(B|Cc)&Dc; A|((B&C)|Dc) ; Ac&B&Cc&D; ...
A&B&C&D; A&Bc&C; Ac&Bc&Cc&D; Ac&B&C; Ac&Bc&Dc; A&Cc; A&C&Dc; A&B&Cc&Dc];DP = 0.001*[1000 200 500 300 700 55 520 200 15 30 195 120 120 ...
140 25 20];
TV = [Ac&((B&Cc)|(Bc&C)); A|(B&Cc)];disp('Call for mincalc')>>mincalc03
Call for mincalc>>mincalc
Data vectors are linearly independentComputable target probabilities
1.0000 0.40002.0000 0.4800
The number of minterms is 16The number of available minterms is 16
Available minterm probabilities are in vector pmaTo view available minterm probabilities, call for PMA>>disp(minmap(pma)) % Display arranged as on minterm map
0.0850 0.0800 0.0200 0.02000.1950 0.2000 0.0500 0.0500
0.0350 0.0350 0.0100 0.01500.0850 0.0850 0.0200 0.0150
The procedure mincalct
A useful modification, which we call mincalct , computes the available target probabilities, without checking and computing the minterm probabilities. This procedureassumes a data file similar to that for mincalc, except that it does not need the target matrix , since it prompts for target Boolean combination inputs. The procedure mincalct may be used after mincalc has performed its operations to calculate probabilitiesfor additional target combinations.
Suppose mincalc has been applied to the data for the opinion survey and that it is desired to determine . It is not necessary to recalculate all the other quantities. We may simply use the procedure mincalct andinput the desired Boolean combination at the prompt.
>>mincalct
Enter matrix of target Boolean combinations (A&D)|(B&Dc)
Computable target probabilities1.0000 0.2850
Repeated calls for mcalct may be used to compute other target probabilities.
Notification Switch
Would you like to follow the 'Applied probability' conversation and receive update notifications?