powered by
The optimal size of knots is chosen by a rule of thumb adapted from Rose (2015).
bw_bern(udata)
optimal order of the Bernstein polynomials.
data.
The formula is max(1,round(n(1/3)∗exp(abs(rho)(1/n))∗(abs(rho)+0.1))), where ρ is the empirical Spearman's rho of the data.