pred_olsgasp: OLS_GaSP model: prediction of missing values

View source: R/pred_olsgasp.R

pred_olsgaspR Documentation

OLS_GaSP model: prediction of missing values

Description

Prediction of missing values of the incomplete with an OLS_GaSP model

Usage

pred_olsgasp(obj)

Arguments

obj

a list of objects create by the function fit_olsgasp.

Value

a matrix without missing values. The original missing values are predicted by the OLS_GaSP model

Author(s)

Melina Ribaud

References

Melina Ribaud, Aurélie Labbe and Karim Oualkacha. Imputation in genetic methylation studies: A linear model of coregionalization (LMC) with informative covariates. 2022. hal-00000000

Gu, M., & Xu, Y. (2020). Fast nonseparable Gaussian stochastic process with application to methylation level interpolation. Journal of Computational and Graphical Statistics, 29(2), 250-260. doi: 10.1080/10618600.2019.1665534

Examples


library(FastGP)
N = 100
K = 10
D = 2
sites = sort(runif(N))
beta = c(runif(D,2,5),runif(K-D,10,1000))
nugget = c(rep(0,D),runif(K-D,0.001,0.05))
A = matrix(runif(K*(K-D),0,0.1),nrow = K, ncol = K-D )
X = matrix(runif(D*K),ncol = D, nrow= K)
Hx = matrix(solve(t(X)%*%X,t(X)),nrow = length(X)/K)
A = A-X%*%Hx%*%A
A = cbind(X,A)
V = matrix(NA, nrow = K, ncol = N)
R00 = abs(outer(sites, sites, '-'))
for (d in 1:K) {
 R = matern_5_2_kernel(R00, beta = beta[d])
 R_tilde = R + nugget[d] * diag(N)
 V[d, ] = rcpp_rmvnorm_stable(1, R, rep(0, N))
}
Y_obs = A %*% V
obj_olsgasp = svd_olsgasp(Y_obs,sites,X,tol_eig = 1e-6)
obj_olsgasp = fit_olsgasp(obj_olsgasp)
Ypred = pred_olsgasp(obj_olsgasp)

melinaR/olsgasp documentation built on March 11, 2023, 12:10 a.m.