A theta function for an arbitrary connected and simply connected compact simple Lie group is defined as an infinite determinant that is naturally related to the transformation of a family of independent Gaussian random variables associated with a pinned Brownian motion in the Lie group. From this definition of a theta function, the equality of the product and the sum expressions for a theta function is obtained. This equality for an arbitrary connected and simply connected compact simple Lie group is known as a Macdonald identity which generalizes the Jacobi triple product for the elliptic theta function associated with su(2).