HCR {HCR} | R Documentation |
Hidden Compact Representation Model
Description
Causal Discovery from Discrete Data using Hidden Compact Representation.
Usage
HCR(X, Y, score_type = "bic", is_anm = FALSE, is_cyclic = FALSE,
verbose = FALSE, max_iteration = 1000, ...)
Arguments
X |
The data of cause. |
Y |
The data of effect. |
score_type |
You can choose "bic","aic","aicc","log" as the type of score to fit the HCR model. Default: bic |
is_anm |
If is_anm=TRUE, it will enable a data preprocessing to adjust for the additive noise model. |
is_cyclic |
If is_anm=TRUE and is_cyclic=TRUE, it will enable a data preprocessing to adjust the cyclic additive noise model. |
verbose |
Show the score at each iteration. |
max_iteration |
The maximum iteration. |
... |
Other arguments passed on to methods. Not currently used. |
Value
The fitted HCR model and its score.
Examples
library(data.table)
set.seed(10)
data=simuXY(sample_size=200)
r1<-HCR(data$X,data$Y)
r2<-HCR(data$Y,data$X)
# The canonical hidden representation
unique(r1$data[,c("X","Yp")])
# The recovery of hidden representation
unique(data.frame(data$X,data$Yp))
[Package HCR version 0.1.1 Index]