A method of solving magnetoencephalographic and electroencephalographic
inverse problems provides better grouping of moments of equivalent
current dipoles than conventional methods. Locations of dipoles are fixed
based on information using fMRI or the like. The magnitudes and
orientations of the dipole moments are adjusted to fit magnetic fields
and/or electrical potential distributions produced by the dipoles to
magnetoencephalographically and/or electroencephalographically measured
data. The method also includes grouping the dipoles in two stages, using
the correlation coefficient of the magnitudes of the dipole moments as a
criterion.