Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using mvsusieR for prediction #47

Open
psoerensen opened this issue Oct 2, 2023 · 4 comments
Open

Using mvsusieR for prediction #47

psoerensen opened this issue Oct 2, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@psoerensen
Copy link

Hi everyone,
I am interested in evaluating mvsusieR for prediction purposes.
In particular I would like to compute Yhat for a test data set based on beta's estimated from a training data set.
See my example code below.
I cannot find any examples doing that or have I missed something?
(I have looked at the examples here: https://stephenslab.github.io/mvsusieR/articles/mvsusie_intro.html)
Kind regards
Peter

Simulated data from mvsusier package

data(simdata)

X <- simdata$raw$X
Y <- simdata$raw$Y

train <- 1:500

prior <- create_mixture_prior(list(matrices = simdata$par$U,
weights = simdata$par$w),
null_weight = 0)

fit <- mvsusie(X[train,],Y[train,],standardize = TRUE,
prior_variance = prior,
residual_variance = simdata$par$V,
estimate_prior_variance = TRUE,
tol = 0.01)

Extract Bhat and compute Yhat

Bhat <- fit$Bhat
Yhat <- X[-train,]%*%Bhat

@gaow
Copy link
Member

gaow commented Oct 2, 2023

We previously had an example for prediction ... @pcarbo should we bring that back or we should suggest people to look into eg mr.mash instead?

@pcarbo
Copy link
Member

pcarbo commented Oct 3, 2023

@gaow susieR has both a coef and predict method and I was only suggesting we do the same in mvsusieR.

@pcarbo pcarbo added the enhancement New feature or request label Oct 3, 2023
@pcarbo
Copy link
Member

pcarbo commented Oct 4, 2023

@psoerensen @fmorgante I have implemented a predict method. See here for examples.

Please let us know if you have questions.

@psoerensen
Copy link
Author

fantastic - many thanks! We will test this in the coming weeks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants