[Paper Review] (f)RFCDE: Random Forests for Conditional Density Estimation and Functional Data
This paper introduces (f)RFCDE, a random forest method optimized for conditional density estimation (CDE) and functional data by modifying tree splitting to minimize a CDE-specific loss function, achieving improved accuracy and computational efficiency over standard regression forests, especially in multimodal or heteroskedastic settings and with high-resolution functional covariates.
Random forests is a common non-parametric regression technique which performs well for mixed-type unordered data and irrelevant features, while being robust to monotonic variable transformations. Standard random forests, however, do not efficiently handle functional data and runs into a curse-of dimensionality when presented with high-resolution curves and surfaces. Furthermore, in settings with heteroskedasticity or multimodality, a regression point estimate with standard errors do not fully capture the uncertainty in our predictions. A more informative quantity is the conditional density p(y | x) which describes the full extent of the uncertainty in the response y given covariates x. In this paper we show how random forests can be efficiently leveraged for conditional density estimation, functional covariates, and multiple responses without increasing computational complexity. We provide open-source software for all procedures with R and Python versions that call a common C++ library.
Motivation & Objective
- Address the limitations of standard random forests in estimating full conditional densities, particularly under heteroskedasticity or multimodality.
- Overcome the curse of dimensionality in functional data by adapting splits to the domain of curves or surfaces rather than treating them as high-dimensional vectors.
- Enable joint conditional density estimation for multiple responses, extending random forests beyond point prediction.
- Maintain computational efficiency while improving estimation accuracy through a novel loss function tailored for density estimation.
- Provide a scalable, open-source implementation with R and Python interfaces for practical use in real-world applications.
Proposed method
- Modify standard random forest splitting by minimizing a CDE-specific $L^2$ loss: $L(p,\widehat{p}) = \mathbb{E}_X[\int \widehat{p}^2(y|X) dy] - 2\mathbb{E}_{X,Y}[\widehat{p}(Y|X)] + C_p$, which accounts for the full distribution of the response.
- Use tree-based weighting: $w_i(x^*, \theta_t) = \mathbbm{1}[X_i \in R(x^*, \theta_t)] / \sum_i \mathbbm{1}[X_i \in R(x^*, \theta_t)]$, and aggregate over $T$ trees to form final weights $w_i(x^*)$.
- Estimate the conditional density via weighted kernel density estimation: $\widehat{p}(y|x^*) = \frac{1}{\sum_i w_i(x^*)} \sum_i w_i(x^*) K_h(Y_i - y)$, with bandwidth selected via plug-in or validation.
- For functional data, partition the functional domain using a Poisson process with parameter $\lambda$, then use the mean of the function over each interval as input to the tree.
- Reduce dimensionality and improve computational efficiency by aggregating function values over intervals rather than treating each grid point as an individual feature.
- Leverage a shared C++ library with R and Python wrappers to ensure high performance and broad accessibility.
Experimental results
Research questions
- RQ1Can random forests be effectively adapted for conditional density estimation by modifying the splitting criterion to directly optimize for density loss?
- RQ2How does the proposed CDE-optimized loss function compare to standard regression loss in capturing multimodal or heteroskedastic response distributions?
- RQ3To what extent does modeling functional covariates through domain partitioning improve performance and reduce computational cost compared to treating them as high-dimensional vectors?
- RQ4Can the method jointly estimate conditional densities for multiple responses while maintaining interpretability and scalability?
- RQ5How does the performance of (f)RFCDE compare to existing methods like quantileRegressionForests and trtf in terms of CDE loss and computational time?
Key findings
- The (f)RFCDE method achieves significantly lower CDE loss than standard regression forests, particularly in settings with multimodal or heteroskedastic responses.
- On functional spectroscopic data from the SDSS, the functional RFCDE approach reduced CDE loss to -29.623 (SE: 0.844) compared to -12.578 (SE: 0.418) for the vector-based baseline.
- The functional RFCDE model achieved faster training time (12.62 seconds) than the vector-based model (21.31 seconds), attributed to reduced effective dimensionality and fewer split searches.
- The method successfully captures complex ridge structures in posterior distributions, such as in weak lensing parameter inference, outperforming point-estimate methods in uncertainty quantification.
- The open-source RFCDE package with R and Python interfaces enables scalable, interpretable modeling of complex data types with full uncertainty quantification.
- The CDE-optimized loss function enables better detection of distributional shifts and non-linear dependencies that standard regression losses may miss.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.