Using one- and two-body density matrices, we calculate the spatial and momentum distributions, two-particle Hanbury-Brown–Twiss (HBT) correlation functions, and the chaotic parameter λ in HBT interferometry for the systems of boson gas within the harmonic oscillator potentials with anisotropic frequencies in transverse and longitudinal directions. The HBT chaotic parameter, which can be obtained by measuring the correlation functions at zero relative momentum of the particle pair, is related to the degree of Bose–Einstein condensation and thus the system environment. We investigate the effects of system temperature, particle number and the average momentum of the particle pair on the chaotic parameter. The value of λ decreases with the condensed fraction, f0. It is one for f0 = 0 and zero for f0 = 1. For a certain f0 between 0 and 1, we find that λ increases with the average momentum of the particle pair and decreases with the particle number of system. The results of λ are sensitive to the ratio, ν = ωz/ωρ, of the frequencies in longitudinal and transverse directions. They are smaller for larger ν when ωρ is fixed. In the heavy-ion collisions at the Large Hadron Collider (LHC) energy the large identical pion multiplicity may possibly lead to a considerable Bose–Einstein condensation. Its effect on the chaotic parameter in two-pion interferometry is worth considering in earnest.