stephenslab / susieR

R package for "sum of single effects" regression.
https://stephenslab.github.io/susieR
Other
174 stars 44 forks source link

Behavior of `s_init` #92

Closed gaow closed 3 years ago

gaow commented 4 years ago

Currently using s_init, the number of effect does not change for the second fit:

> fit  <- susie(X,y,L = 3)
> fit2 <- susie(X,y,L = 2,s_init = fit)
> fit2$alpha
       [,1]   [,2]   [,3]   [,4]   [,5]
[1,] 0.1912 0.2306 0.2355 0.2120 0.1307
[2,] 0.1911 0.2304 0.2357 0.2121 0.1306
[3,] 0.1923 0.2321 0.2339 0.2107 0.1310
> fit$alpha
       [,1]   [,2]   [,3]   [,4]   [,5]
[1,] 0.1891 0.2274 0.2385 0.2144 0.1305
[2,] 0.1913 0.2310 0.2356 0.2119 0.1302
[3,] 0.1936 0.2339 0.2320 0.2092 0.1313

Not sure if it is a desirable behavior. I think when L differs between fits, then they are not the same model anyways. In that argument perhaps current behavior is justifiable. One can in part bypass this problem using susie_init_coef but it is not exactly the same as initializing it with a previous fit.

pcarbo commented 4 years ago

When running fit2 <- susie(X,y,L = 2,s_init = fit), I recommend producing an error since the behaviour is not well-defined.

For background, my aim is to initialize using a previous fit, but reduce L. Perhaps a separate interface would be needed for this, e.g., susie_prune_single_effects.

pcarbo commented 4 years ago

I should also add that susie doesn't complain when the rows of s_init$alpha aren't valid probability tables.