CausalKinetiX.modelranking: CausalKinetix.modelranking

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Applies CausalKinetiX framework to rank a list models according to their stability.

Usage

1
CausalKinetiX.modelranking(D, times, env, target, models, pars = list())

Arguments

D

data matrix. Should have dimension n x (L*d), where n is the number of repetitions (over all experiments), L is the number of time points and d is the number of predictor variables.

times

vector of length L specifying the time points at which data was observed.

env

integer vector of length n encoding to which experiment each repetition belongs.

target

integer specifing which variable is the target.

models

list of models. Each model is specified by a list of vectors specifiying the variables included in the interactions of each term.

pars

list of the following parameters: pen.degree (default 2) specifies the penalization degree in the smoothing spline, num.folds (default 2) number of folds used in cross-validation of smoothing spline, include.vars (default NA) specifies variables that should be included in each model, include.intercept (default FALSE) specifies whether to include a intercept in models, average.reps (default FALSE) specifies whether to average repetitions in each environment, smooth.X (default FALSE) specifies whether to smooth predictor observations before fitting, smooth.Y (default FALSE) specifies whether to smooth target observations before fitting, regression.class (default OLS) other options are signed.OLS, optim, random.forest, sample.splitting (default "loo") either leave-one-out (loo) or no splitting (none), score.type (default "mean_absolute") specifies the type of score funtion to use (note that "mean" and "max" are proportional scores which should be used if the noise variance is expected to change across experiments, if this is not the case "mean_absolute" and "max_absolute" are prefered as they also work for perfect unconstrained spline fits), integrated.model (default TRUE) specifies whether to fit the integrated or the derived model, splitting.env (default NA) an additonal environment vector used for scoring, weight.vec (default rep(1, length(env)) a weight vector used when scoring.type=="weighted.mean", set.initial (default FALSE) specifies whether to fix the initial value, silent (default TRUE) turn of additional output, show.plot (default FALSE) show diagnostic plots.

Details

This function scores a specified list of models and does not include a variable ranking.

Value

returns a list with the entries "scores" and "parameter"

Author(s)

Niklas Pfister, Stefan Bauer and Jonas Peters

References

Pfister, N., S. Bauer, J. Peters (2018). Identifying Causal Structure in Large-Scale Kinetic Systems ArXiv e-prints (arXiv:1810.11776).

See Also

The function CausalKinetiX is a wrapper for this function that also computes the variable ranking and generates sensible classes of models.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Generate data from Maillard reaction
simulation.obj <- generate.data.maillard(target=1,
                                         env=rep(1:5, 3),
                                         L=20,
                                         par.noise=list(noise.sd=1))
D <- simulation.obj$simulated.data
time <- simulation.obj$time
env <- simulation.obj$env
target <- simulation.obj$target

## Fit data to the following two models using CausalKinetiX:
## 1: dy = theta_1*x_1 + theta_2*x_2 + theta_3*x_1*x_10 (true model)
## 2: dy = theta_1*x_2 + theta_2*x_4 + theta_3*x_3*x_10 (wrong model)
ck.fit <- CausalKinetiX.modelranking(D, time, env, target,
                                     list(list(1, 2, c(1, 10)), list(2, 4, c(3, 10))))
print(ck.fit$scores)

CausalKinetiX documentation built on June 20, 2019, 5:02 p.m.