predict_comte | R Documentation |
The function takes returned object from comte and testing data as input. Return value is the prediction for corresponding output.
predict_comte(comte_obj, newx)
comte_obj |
returned object from comte function that contains important information for predicting. |
newx |
m x p matrix corresponds to testing data. |
esty
: m x q matrix of estimated y based on newx.
## generate data p = 10 q = 5 n = 50 x = matrix(rnorm(n*p,0,10), n, p) beta = matrix(rnorm(p*q,0,10), q, p) e = matrix(rnorm(n*q,0,0.1),n,q) y = x %*% t(beta) + e s2 = matrix(rep(0.1,q), q, 1) ## initialize parameters for EM algorithm x_test = matrix(rnorm(n*p,0,1), n, p) ## set minimal variance estimation min_s2 = 0.1 output1 = comte(y=y, x=x, S=beta, min_s2=0.1) esty1 = predict_comte(output1, x_test) ## use distinct variance from multivariate linear regression models output2 = comte(y=y, x=x, S=cbind(beta,s2)) esty2 = predict_comte(output2, x_test)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.