Learn R Programming

RFlocalfdr (version 0.9)

f.fit: fit a spline to the histogram of imp

Description

fit a spline to the histogram of imp

Usage

f.fit(imp, df = 10, debug.flag = 0, temp.dir = NULL)

Value

a list with the following components

  • "x" -- midpoints of the histogram

  • "zh" -- a histogram object as returned by "hist"

  • "f.spline" -- the spline fit. The fit is given by a glm mode glm(zh$counts ~ splines::ns(x), poisson)

  • "counts" the counts from the histogram

Arguments

imp

the variable importances

df

the degrees of freedom for the spline fit

debug.flag

either 0 (no debugging information), 1 or 2

temp.dir

if debug flag is >0 then information is written to temp.dir

Examples

Run this code
data(imp20000)
imp <- log(imp20000$importances)
res <- f.fit(imp)
plot(res$zh, xlab="importances", main="histogram of importances")
points(res$midpoints,res$counts, col="grey90")
lines(res$zh$breaks[-1],res$f.spline,col="blue", lwd=3)
legend("topleft",c("spline fit"), col="blue", lwd=3)

Run the code above in your browser using DataLab