We are thinking of implementing in Stata a method that we have already implemented in R. I am looking for suggestions regarding which functions and commands to use in Stata.
The method, which is described here, requires:
(1) interpolating a cubic spline through approximately 10 points of an empirical cumulative distribution function (CDF). The cubic spline is a smooth estimate of the true CDF.
(2) differentiating the CDF to estimate the probability density function (PDF).
(3) applying numeric integration to functions of the PDF and CDF to estimate summary statistics such as the mean, sd, and Gini.
What tools would you recommend. I see there are several tools for interpolation, splines, differentiation, and integration, but I'm not sure how well each of them would work for this purpose. The application requires some things which are not always required in other applications. For example, the cubic spline CDF must be constrained to be monotone increasing, and it must be available as a mathematical function, so that it can be differentiated.
Thanks for any suggestions!
The method, which is described here, requires:
(1) interpolating a cubic spline through approximately 10 points of an empirical cumulative distribution function (CDF). The cubic spline is a smooth estimate of the true CDF.
(2) differentiating the CDF to estimate the probability density function (PDF).
(3) applying numeric integration to functions of the PDF and CDF to estimate summary statistics such as the mean, sd, and Gini.
What tools would you recommend. I see there are several tools for interpolation, splines, differentiation, and integration, but I'm not sure how well each of them would work for this purpose. The application requires some things which are not always required in other applications. For example, the cubic spline CDF must be constrained to be monotone increasing, and it must be available as a mathematical function, so that it can be differentiated.
Thanks for any suggestions!
Comment