impute {MOFA} | R Documentation

## Impute missing values from a fitted MOFA model

### Description

This function uses the latent factors and the loadings inferred in order to impute missing values.

### Usage

    impute(object, views = "all", factors = "all", type = c("inRange",
      "response", "link"))

### Arguments

`object` | a `MOFAmodel` object.
`views` | character vector with the view names, or numeric vector with view indexes.
`factors` | character vector with the factor names, or numeric vector with the factor indexes.
`type` | type of prediction returned, either: response: gives the response vector, the mean for Gaussian and Poisson, and success probabilities for Bernoulli. link: gives the linear predictions. inRange: rounds the fitted values of integer-valued distributions (Poisson and Bernoulli) to the next integer. This is the default option.

### Details

Matrix factorization models generate a denoised and condensed low-dimensional representation of the data which capture the main sources of heterogeneity of the data. Such representation can be used to do predictions via the equation `Y = WZ`.
This method fills the `ImputedData` slot by replacing the missing values in the training data with the model predictions.
For more details see the Methods section of the MOFA article.

### Value

a `MOFAmodel` object with imputed data in the `ImputedData` slot

### Examples

    # Load CLL data
    filepath <- system.file("extdata", "CLL_model.hdf5", package = "MOFAdata")
    MOFA_CLL <- loadModel(filepath)
    # impute missing data in all views using all factors
    MOFA_CLL <- impute(MOFA_CLL)

    # Load scMT data
    filepath <- system.file("extdata", "scMT_model.hdf5", package = "MOFAdata")
    MOFA_scMT <- loadModel(filepath)
    # impute missing data in the RNA view using Factor 1
    MOFA_scMT <- impute(MOFA_scMT, views="RNA expression", factors="LF1")

[Package MOFA version 1.0.0 Index]