Cal_Phat: Cal_Phat:calculate the confidence index

Description Usage Arguments Examples

View source: R/Cal_Phat.R

Description

This is the first step in RICWL. It calcualtes the confidence index based on the sum of similarity weighted indicator functions.

Usage

1
2
3
4
5
6
7
8
9
Cal_Phat(
  x,
  y,
  A,
  XS = NULL,
  method = c("cos", "frac"),
  frac.par = 0.5,
  sim.par = 0.2
)

Arguments

x:

n by P feature matrix

y:

outcome or residual vector with sizse n

A:

treatment, takes value -1 and +1 with size n

XS:

names of feature should be used for similarity calculation, if NULL then use all

method:

either cosine or fraction similarity, default is cosine "cos"

frac.par:

the parameter needed for fraction similarity calculation

sim.par:

hyper-parameter governing the definition of neighborhood. It is the minimal similairty quantile for neighborhood

Examples

1
2
3
4
5
6
n = 200
p = 5
H = matrix(rnorm(n*p), nrow=n)
A = rbinom(n=n, size=1, prob=0.5)*2 - 1
R2 = 4*H[,1]^2 + A*(H[,2]^2 + H[,4]^2 < 1.5)
Cal_Phat(x=H, y=R2, A=A)

sambiostat/RICWL documentation built on Dec. 31, 2020, 3:17 a.m.