powered by
This function outputs the nth derivative of a histogram smooth.
get.deriv.smooth.hist(x, coefs, knots, deg = 4, deriv.deg = 1)
Derivative of smoothed histogram
values from smooth_hist
Coefficients from GAM from smooth_hist
Number of knots fit for GAM
Degree of polynomials
The degree of the derivative.
data(smoothed_histogram) dy<-get.deriv.smooth.hist(xvals, coefs=s.hist$coefs, knots=s.hist$knots, deg=s.hist$deg, deriv.deg=1)
Run the code above in your browser using DataLab