impute_tskrr: Impute missing values in a label matrix

Description Usage Arguments Value Examples

View source: R/impute_tskrr.R

Description

This function implements an optimization algorithm that allows imputing missing values in the label matrix while fitting a tskrr model.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
impute_tskrr(
  y,
  k,
  g = NULL,
  lambda = 0.01,
  testdim = TRUE,
  testlabels = TRUE,
  symmetry = c("auto", "symmetric", "skewed"),
  keep = FALSE,
  niter = 10000,
  tol = sqrt(.Machine$double.eps),
  start = mean(y, na.rm = TRUE),
  verbose = FALSE
)

Arguments

y

a label matrix

k

a kernel matrix for the rows

g

an optional kernel matrix for the columns

lambda

a numeric vector with one or two values for the hyperparameter lambda. If two values are given, the first one is used for the k matrix and the second for the g matrix.

testdim

a logical value indicating whether symmetry and the dimensions of the kernel(s) should be tested. Defaults to TRUE, but for large matrices putting this to FALSE will speed up the function.

testlabels

a logical value indicating wether the row- and column names of the matrices have to be checked for consistency. Defaults to TRUE, but for large matrices putting this to FALSE will speed up the function.

symmetry

a character value with the possibilities "auto", "symmetric" or "skewed". In case of a homogeneous fit, you can either specify whether the label matrix is symmetric or skewed, or you can let the function decide (option "auto").

keep

a logical value indicating whether the kernel hat matrices should be stored in the model object. Doing so makes the model object quite larger, but can speed up predictions in some cases. Defaults to FALSE.

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.

Value

A tskrr model of the class tskrrImputeHeterogeneous or tskrrImputeHomogeneous depending on whether or not g has a value.

Examples

1
2
3
4
5
6

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