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 the fractional matter density of the universe \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 \leq z \leq 2 ( ( ( Wang 2000 ) ) ) . 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 the dark energy density 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 the dark energy density 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 the dark energy density and \Omega _ { m } by devoting more observational time to the central pencil beam fields to obtain more SNe Ia at z > 1.2 . We use both maximum likelihood analysis and Monte Carlo ( when appropriate ) to determine the errors of estimated parameters . We find that Monte Carlo analysis gives a more accurate estimate of the dark energy density than the maximum likelihood analysis .