A function to estimate individual alphas for Dirichlet distribution to approximate the observed quantiles with means as known moments for SoilGrids soil texture data. Dirichlet distribution is assumed as soil texture data follow categorical distribution and the probability of each category is in the range 0 to 1, and all must sum to 1.

estimate_dirichlet_parameters(means, quantiles)

Arguments

means

A vector of means of sand, clay, and silt proportion for one soil layer at one site from SoilGrids data

quantiles

A list of 5th, 50th, and 95th percentiles for sand, clay, and silt for one soil layer at one site from SoilGrids data

Value

The individual alphas that work best to fit the observed quantiles

Author

Qianyu Li

Examples

if (FALSE) { # \dontrun{
# Means and percentiles for each category: sand, clay, and silt at one site and one depth
means <- c(0.566,0.193,0.241)
quantiles <-list(
  q5 = c(0.127,0.034,0.052), # 5th percentile
  q50 = c(0.615,0.15,0.191), # 50th percentile (median)
  q95 = c(0.799,0.66,0.616))  # 95th percentile
alpha_est <- estimate_dirichlet_parameters(means, quantiles)
} # }