jgscott / FDRreg

False discovery rate regression
10 stars 10 forks source link

Warning: "Rerun with increased df" #2

Open kdkorthauer opened 6 years ago

kdkorthauer commented 6 years ago

Hi,

I'm trying to run FDRreg with default parameters except for nulltype='empirical'. However, I get many warnings like the following:

f(z) misfit = -0.2. Rerun with increased df.

I think I have tracked this down to the efron function call. It seems to be an issue with the fitting of the empirical Z-score distribution. The warning suggests to run with an increased degrees of freedom, which is taken from the control input list (specifically, the densknots parameter, default value is 10). I tried to get advice for how much to increase this parameter from the documentation, but was a bit confused by the help file for FDRreg, which says:

nmids, densknots: Only used if method='efron'; this functionality is retained for legacy reasons and is not recommended for actual data analysis. nmids: How many histogram midpoints are used in Efron's spline-based estimator of f(z). Defaults to 150. densknots: how many spline knots. Defaults to 10.

Is the 'empirical' null type not recommended for actual data analysis? If it is, do you have any practical advice for how to set this densknots parameter?

Thanks in advance, Keegan

jgscott commented 6 years ago

Thanks for bringing this up. You can use densknots with a higher value and it will behave as you expect, i.e. with a higher degrees of freedom for Efron's central matching estimator for the empirical null. It's the documentation that's deprecated rather than the function.