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.

  1. All transactions must have values at any k position equal to z[k] for any z[k] that is not -1. Let count be the number of these transactions in D.

  2. All transactions must have values at any k position equal to either z[k] or y[k] that is not -1. Let countTotal be the number of these transactions in D.

Usage

CondProb(D, y, z)

Arguments

D

is an aligned list of transactions that was converted from any matrix n by d mat using D<-VecAlignment(mat) where n is a number of transactions or samples and d is a number of dimensions for each sample.

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 y given z in D.

nD

The subset of D such that all transactions have values at any position similar to z[k] when z[k] is not -1.

count

A number of transactions that have values at any position similar to either z[k] or y[k] that is not -1.

countTotal

A number of transactions in nD

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


[Package BiCausality version 0.1.4 Index]