When I try to plot the siberDensityPlot of my Posterior probability distribution of the 6 Layman's metrics, I get the following error when running the Siberdensityplot()
Error in hdrcde::hdr(SEA.B[, j], probs, h = stats::bw.nrd0(SEA.B[, j])) : Insufficient data
This is my code, which I copied from Jackson "Introduction to SIBER" 2017
# extract the posterior means
mu.post <- extractPosteriorMeans(siber.example, ellipses.posterior)
# calculate the corresponding distribution of layman metrics
layman.B <- bayesianLayman(mu.post)
# --------------------------------------
# Visualise the first community
# --------------------------------------
siberDensityPlot(layman.B[[2]], xticklabels = colnames(layman.B[[2]]),
bty="L", ylim = c(0,3))
# add the ML estimates (if you want). Extract the correct means
# from the appropriate array held within the overall array of means.
comm1.layman.ml <- laymanMetrics(siber.example$ML.mu[[1]][1,1,],
siber.example$ML.mu[[1]][1,2,]
)
points(1:6, comm1.layman.ml$metrics, col = "red", pch = "x", lwd = 2)
The result is a box plot with displayed the dY_range the dX_range with the respective distributions, but none of the remaining metrics (TA, CD, NND, SDNND) for which I supposedly have insufficient data. How can I understand where the issue is? The data are private and cannot be shared (company rules).