  The effect of pressure on optical phonon frequencies of MgB$_2$ has been
calculated using the frozen-phonon approach based on a pseudopotential method.
Gr\"uneisen parameters of the harmonic mode frequencies are reported for the
high-frequency zone-center $E_{2g}$ and $B_{1g}$ and the zone-boundary $E_{2u}$
and $B_{2u}$ modes at $A$. Anharmonic effects of phonon frequencies and the
implications of the calculated phonon frequency shifts for the pressure
dependence of the superconducting transition temperature of MgB$_2$ are
discussed. Also reported are Raman and optical reflectance spectra of MgB$_2$
measured at high pressures. The experimental observations in combination with
calculated results indicate that broad spectral features we observed in the
Raman spectra at frequencies between 500 and 900 cm$^{-1}$ cannot be attributed
to first-order scattering by zone-center modes, but originate in part from a
chemical species other than MgB$_2$ at the sample surface and in part from a
maximum in the MgB$_2$ phonon density of states. Low-temperature Raman spectra
taken at ambient pressure showed increased scattering intensity in the region
below 300 cm$^{-1}$.
