impute_tskrr.fit {xnet} | R Documentation |
Impute values based on a two-step kernel ridge regression
Description
This function provides an interface for the imputation of values
based on a tskrr
model and is the internal function
used by impute_tskrr
.
Usage
impute_tskrr.fit(y, Hk, Hg, naid = NULL, niter, tol, start, verbose)
Arguments
y |
a label matrix |
Hk |
a hat matrix for the rows (see also |
Hg |
a hat matrix for the columns. For homogeneous networks, this should be Hk again. |
naid |
an optional index with the values that have to be imputed,
i.e. at which positions you find a |
niter |
an integer giving the maximum number of iterations |
tol |
a numeric value indicating the tolerance for convergence of the algorithm. It is the maximum sum of squared differences between to iteration steps. |
start |
a numeric value indicating the value with which NA's are replaced in the first step of the algorithm. Defaults to 0. |
verbose |
either a logical value, 1 or 2. |
Details
This function is mostly available for internal use. In most cases,
it makes much more sense to use impute_tskrr
, as that
function returns an object one can work with. The function
impute_tskrr.fit
could be useful when doing simulations or
creating fitting algorithms.
Value
a list with two elements:
a matrix
y
with the imputed values filled in.a numeric value
niter
with the amount of iterations
See Also
-
impute_tskrr
for the user-level function, and -
eigen2hat
for conversion of a eigen decomposition to a hat matrix.
Examples
data(drugtarget)
K <- eigen(targetSim)
G <- eigen(drugSim)
Hk <- eigen2hat(K$vectors, K$values, lambda = 0.01)
Hg <- eigen2hat(G$vectors, G$values, lambda = 0.05)
drugTargetInteraction[c(3,17,123)] <- NA
res <- impute_tskrr.fit(drugTargetInteraction, Hk, Hg,
niter = 1000, tol = 10e-10,
start = 0, verbose = FALSE)