Description Usage Arguments Value Examples
Fit a Gaussian process or Student-t process to the treatment and control surface.
1 2 3 4 | CausalStump(y, X, z, w, pscore, kernelfun = "SE", myoptim = "Nadam",
maxiter = 5000, tol = 1e-04, prior = FALSE, nu = 200,
nsampling = 5000, learning_rate = 0.01, beta1 = 0.9, beta2 = 0.999,
momentum = 0)
|
y |
A vector |
X |
A data.frame |
z |
A vector |
w |
A vector (optional) |
pscore |
A vector (optional) |
kernelfun |
A string (default: SE) |
myoptim |
A string (default: Gradient Descent – GD) |
maxiter |
(default: 5000) |
tol |
(default: 1e-4) |
prior |
A logic statement (default: FALSE) |
nu |
A value (default: 200) |
nsampling |
A value (default: 5000) number of samples for prediction |
learning_rate |
(default: 0.01) |
beta1 |
(default: 0.9) |
beta2 |
(default: 0.999) |
momentum |
(default: 0.0) |
The function returns the fitted process as a CausalStump class object
1 2 3 4 5 6 7 8 9 10 11 12 | #Generate data
n = 120
Z = rbinom(n, 1, 0.3)
X0 = runif(n-sum(Z), min = 20, max = 40)
X = data.frame(matrix(NaN,n,1))
X[Z==1,] = X1; X[Z==0,] = X0
y0_true = as.matrix(72 + 3 * sqrt(X))
y1_true = as.matrix(90 + exp(0.06 * X))
Y0 = rnorm(n, mean = y0_true, sd = 1)
Y1 = rnorm(n, mean = y1_true, sd = 1)
Y = Y0*(1-Z) + Y1*Z
mystump <- CausalStump(Y,X,Z)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.