interpolate_factors {MOFA2} | R Documentation

## Interpolate factors in MEFISTO based on new covariate values

### Description

Function to interpolate factors in MEFISTO based on new covariate values.

### Usage

    interpolate_factors(object, new_values)

### Arguments

`object` | a `MOFA` object trained with MEFISTO options and a covariate
`new_values` | a matrix containing the new covariate values to inter/extrapolate to. Should be in the same format as the covariated used for training.

### Details

This function requires the functional MEFISTO framework to be used in training. Use `set_covariates` and specify mefisto_options when preparing the training using `prepare_mofa`. Currenlty, only the mean of the interpolation is provided from R.

### Value

Returns the `MOFA` with interpolated factor values filled in the corresponding slot (interpolatedZ)

### Examples

    # Using an existing trained model
    file <- system.file("extdata", "MEFISTO_model.hdf5", package = "MOFA2")
    model <- load_model(file)
    model <- interpolate_factors(model, new_values = seq(0,1.1,0.01))

[Package MOFA2 version 1.2.2 Index]