  Type Ia supernovae (SNe Ia) are currently the best probes of the dark energy
in the universe. To constrain the nature of dark energy in a model-independent
manner, we allow the density of dark energy, $\rho_X(z)$, to be an arbitrary
function of redshift. Using simulated data from a space-based supernova pencil
beam survey, we find that by optimizing the number of parameters used to
parametrize the dimensionless dark energy density,
$f(z)=\rho_X(z)/\rho_X(z=0)$, we can obtain an unbiased estimate of both f(z)
and $\Omega_m$ (assuming a flat universe and that the weak energy condition is
satisfied). A plausible supernova pencil beam survey (with a square degree
field of view and for an observational duration of one year) can yield about
2000 SNe Ia with $0\le z \le 2$. Such a survey in space would yield SN peak
luminosities with a combined intrinsic and observational dispersion of $\sigma
(m_{int})=0.16$ mag. We find that for such an idealized survey, $\Omega_m$ can
be measured to 10% accuracy, and f(z) can be estimated to $\sim$ 20% to $z \sim
1.5$, and $\sim$ 20-40% to $z \sim 2$, depending on the time dependence of the
true dark energy density. Dark energy densities which vary more slowly can be
more accurately measured. For the anticipated SNAP mission, $\Omega_m$ can be
measured to 14% accuracy, and f(z) can be estimated to $\sim$ 20% to $z \sim
1.2$. Our results suggest that SNAP may gain much sensitivity to the
time-dependence of f(z) and $\Omega_m$ by devoting more observational time to
the central pencil beam fields to obtain more SNe Ia at z>1.2. We also find
that Monte Carlo analysis gives a more accurate estimate of the dark energy
density than the maximum likelihood analysis. (abridged)
