$q$ refers to partitioning the set of values into $q$ subsets of (nearly) equal sizes. Check Specialized quantiles in your source.
If you look for a specific quantile $p$, you might express it as $p=k/q$, for example "second decile" where $k=2$
if $h$ is an integer, $h$ can be used as it is as an element index. As your ref says, perhaps not in the neatest way I have seen so far:
When h is an integer, the h-th smallest of the N values, $x_h$, is the
you might be able to (estimate/calculate) a quantile by looking at the $h$-th indexed element in your the sorted list of (sample/real) population values.
In the most basic example that pops in my head, if you have 10 elements and you would like to calculate the 9th-decile, you could sort your 10 elements and then pick the 9th.
There's a mapping between a quantile (real -valued) and $h$. In the text, they decide to have $h$ be either an integer or a float. You might end-up having a real valued $h$. If you're looking for the 95-something-percentile ($p=0.957658$), well, then as your ref suggests, you would need to:
- apply the floor and ceiling function to $h$
- interpolate (in some way) the elements
I think it would have been neater to use $h$ as an integer valued index valued and have some other quantile (real-value) variable rather than have $h$ be either integer or real-valued and adjust the algo accordingly.