fit_olsgasp | R Documentation |
Estimation of the paramaters of the OLS_GaSP model model
fit_olsgasp(obj)
obj |
a list of objects create by the function svd_olsgasp. |
a list with all the object necessary to the prediction.
Melina Ribaud
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
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.