A solution of the forward problem is an important component of any method f
or computing the spatio-temporal activity of the neural sources of magnetoe
ncephalography (MEG) and electroencephalography (EEG) data. The forward pro
blem involves computing the scalp potentials or external magnetic field at
a finite set of sensor locations for a putative source configuration. We pr
esent a unified treatment of analytical and numerical solutions of the forw
ard problem in a form suitable for use in inverse methods, This formulation
is achieved through factorization of the lead field into the product of th
e moment of the elemental current dipole source with a "kernel matrix" that
depends on the head geometry and source and sensor locations, and a "senso
r matrix" that models sensor orientation and gradiometer effects in MEG and
differential measurements in EEG, Using this formulation and a recently de
veloped approximation formula for EEG, based on the "Berg parameters," we p
resent novel reformulations of the basic EEG and MEG kernels that dispel th
e myth that EEG is inherently more complicated to calculate than MEG. We al
so present novel investigations of different boundary element methods (BEM'
s) and present evidence that improvements over currently published BEM meth
ods can be realized using alternative error-weighting methods. Explicit exp
ressions for the matrix kernels for MEG and EEG for spherical and realistic
head geometries are included.