You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@william-denault It is important to output the intercept for several reasons, but one is that it is often helpful to be able to use the model to predict Y (e.g., to compare the observed Y with the predicted Y). This also provides a simple "sanity check" to make sure that the model fitting is working. You will notice that susieR has two related features: (i) it returns the "fitted" values (in fit$fitted) and (ii) it has a "predict" method. Here's an example of what I mean:
(In this case, fit$fitted and ypred give the same result.)
I suggest implementing (i) and (ii) for fsusieR, which should be straightforward once you have the intercept.
Note that the intercept is not simply the the mean of Y, but the mean after removing the effects of the SNPs. See line 460 of susie.R for how this is implemented in susieR. The general formula looks something like this:
$$
(Z^TZ)^{-1} Z\bar{r}, \quad
\bar{r} = y - X\bar{b}
$$
For an intercept, Z is simply a column of ones.
The text was updated successfully, but these errors were encountered:
It is less straightforward in this context.
The main problem about fitted values/prediction is that to run fsusie, the Y matrix is expected to have 2^J columns, and when it is not the case, we actually remap the data using an interpolation scheme so that there are 2^J columns (see intro vignette section #### Handling function of any length and unevenly space data) . So the actual output of fsusie is a list of the fitted functions of length 2^J
So, the "real" predictions are actually made on this grid. How should we proceed? Should we make different "predict" functions, one that uses the estimate and the other one that outputs an "interpolated version" of the prediction on the original grid?
I've removed the section on "prediction" in the introductory vignette since I agree it is a bit complicated, and we don't want to mislead. (This example suggests that it is simpler than it actually is.)
I want to leave this issue open as a reminder to myself to fix some other things.
@william-denault It is important to output the intercept for several reasons, but one is that it is often helpful to be able to use the model to predict Y (e.g., to compare the observed Y with the predicted Y). This also provides a simple "sanity check" to make sure that the model fitting is working. You will notice that susieR has two related features: (i) it returns the "fitted" values (in
fit$fitted
) and (ii) it has a "predict" method. Here's an example of what I mean:(In this case,
fit$fitted
andypred
give the same result.)I suggest implementing (i) and (ii) for fsusieR, which should be straightforward once you have the intercept.
Note that the intercept is not simply the the mean of Y, but the mean after removing the effects of the SNPs. See line 460 of susie.R for how this is implemented in susieR. The general formula looks something like this:
For an intercept, Z is simply a column of ones.
The text was updated successfully, but these errors were encountered: