  Theory suggests that about 10% of Swift-detected gamma-ray bursts (GRBs) will
originate at redshifts greater than 5 yet a number of high redshift candidates
may be left unconfirmed due to the lack of measured redshifts. Here we
introduce our code, GRBz, a method of simultaneous multi-parameter fitting of
GRB afterglow optical and near infrared, spectral energy distributions. It
allows for early determinations of the photometric redshift, spectral index and
host extinction to be made. We assume that GRB afterglow spectra are well
represented by a power-law decay and model the effects of absorption due to the
Lyman forest and host extinction. We use a genetic algorithm-based routine to
simultaneously fit the parameters of interest, and a Monte Carlo error
analysis. We use GRBs of previously determined spectroscopic redshifts to prove
our method, while also introducing new near infrared data of GRB 990510 which
further constrains the value of the host extinction. Our method is effective in
estimating the photometric redshift of GRBs, relatively unbiased by assumptions
of the afterglow spectral index or the host galaxy extinction. Monte Carlo
error analysis is required as the method of error estimate based on the optimum
population of the genetic algorithm underestimates errors significantly.
