CondProb {BiCausality} | R Documentation |
CondProb function
Description
This function computes a confidence value of y
given c
or conf(y|z)
from an aligned list D
.
For anyy[i],z[j]
, their values are -1 by default.
The function computes the numbers of transactions
that satisfy the following conditions.
All transactions must have values at any k position equal to
z[k]
for anyz[k]
that is not -1. Letcount
be the number of these transactions inD
.All transactions must have values at any k position equal to either
z[k]
ory[k]
that is not -1. LetcountTotal
be the number of these transactions inD
.
Usage
CondProb(D, y, z)
Arguments
D |
is an aligned list of transactions that was converted from any matrix n by d |
y |
is a d-dimensional vector. |
z |
is a d-dimensional vector. |
Value
This function returns the ratio condP=count/countTotal
, which is the confidence of y
given z
.
condP |
The confidence of |
nD |
The subset of |
count |
A number of transactions that have values at any position similar
to either |
countTotal |
A number of transactions in |
Examples
d=10 # dimensions of example vectors
z<-numeric(d)-1
y<-numeric(d)-1
y[1]<-c(1)
z[c(2,3)]<-c(1,1)
CondProb(BiCausality::D,y=y,z=z)$condP # conf(inx1 is 1 |inx 2,3 are 1 ) y|z