impute_tskrr.fit: Impute values based on a two-step kernel ridge regression

Description Usage Arguments Details Value See Also Examples

View source: R/impute_tskrr.fit.R

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

1
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 eigen2hat on how to calculate them from an eigen decomposition)

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 NA value. It can be a vector with integers or a matrix with TRUE/FALSE values.

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. 1 means "show the number of iterations and the final deviation", 2 means "show the deviation every 10 iterations". A value TRUE is read as 1.

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:

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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)

xnet documentation built on Feb. 4, 2020, 9:10 a.m.