Is there any way to estimate the degrees of freedom from a kernel density estimator?
Background: I want to compare the fitting I get with a parametric distribution with that of a kernel density estimation (with ksdensity). By 'compare' I mean to use the Akaike IC. I can calculate the loglikelihood with the info that ksdensity returns, but what about the number of parameters (or degrees of freedom)? How many parameters does ksdensity actually estimates? According to the literature the trace of the smoothing matrix is a good estimate of the DOF, but this matrix is not returned by ksdensity.