In a previous paper (Zong Z, Lam KY. Estimation of complicated disributions using B-spline functions. Structural safety 1998; 20(4): 323–32), we used a linear combination of B-spline functions to approximate complicated distributions. The method works well for large samples. In this paper, we extend the method to small samples. We still use a linear combination of B-spline functions to approximate a complicated probability density function (p.d.f). Strongly influenced by statistical fluctuations, the combination coefficients (unknown parameters) estimated from a small sample are highly irregular. Useful information is, however, still contained in these irregularities, and likelihood function is used to pool the information. We then introduce smoothness restriction, based on which the so-called smooth prior distribution is constructed. By combining the sample information (likelihood function) and the smoothness information (smooth prior distribution) in the Bayes' theorem, the influence of statistical fluctuations is effectively removed, and greatly improved estimation, which is close to the true distribution, can be obtained by maximizing the posterior probability. Moreover, an entropy analysis is employed to find the most suitable prior distribution in an "objective" way. Numerical experiments have shown that the proposed method is useful to identify an appropriate p.d.f. for a continuous random variable directly from a sample without using any prior knowledge of the distribution form. Especially, the method applies to large or small samples.