Ted wanted to know the number of observations for each metric that led to the calculated percentiles. These are different than the number of data available since it depends on the calculations coming out of the FFC. This should be relatively trivial to add into the percentile calculation code, but we'd then need to make sure to drop it anywhere else where we don't need it, but need to merge with the predicted percentiles. It could also come out as a separate table. Here's the code we used to calculate it as a oneoff, in case that's useful - it'd be good to switch the for loop to an apply, but had trouble since the structure of the ffc_results data meant that getting the name of each metric was not straightforward outside of a loop:
Ted wanted to know the number of observations for each metric that led to the calculated percentiles. These are different than the number of data available since it depends on the calculations coming out of the FFC. This should be relatively trivial to add into the percentile calculation code, but we'd then need to make sure to drop it anywhere else where we don't need it, but need to merge with the predicted percentiles. It could also come out as a separate table. Here's the code we used to calculate it as a oneoff, in case that's useful - it'd be good to switch the for loop to an apply, but had trouble since the structure of the ffc_results data meant that getting the name of each metric was not straightforward outside of a loop: