Source designature for seismic data acquired using an air-gun array aims to remove the effects of pulse asymmetry, bubble oscillation, array directivity, and ghosting at the sea surface. For the process to be successful, we require an accurate representation of the source signature in the far field over the full data bandwidth. The well-established approach to this problem is to derive signatures from hydrophone data recorded in the near field of the source array. We perform a least-squares inversion of the near-field data, using a representation of the physics of propagation within the vicinity of the array, according to the measured geometry and incorporating bubble motion and source ghost formation. While ghost formation is typically treated using a simple linear model of propagation and reflection at the sea surface, observations suggest that this may be too simplistic. For example, ghost amplitudes are often found to be lower than expected, and features indicative of acoustically induced cavitation are observed. Hence there is interest in developing approaches that allow us to solve for the ghost directly using additional measurements made in the near field. We present an approach that builds on the standard method of inverting for notional sources and that seeks to take account of nonlinear perturbations to the downgoing wavefield, including attenuation of the ghost. Perturbation of the ghost is described using a series of virtual notional sources situated in the water column between the guns and the sea surface. This is found to provide a more accurate treatment of the ghost and does not require optimization of model parameters as is often necessary in practice with the standard approach. It is also found that the inversion is more stable than an alternative parameter-free approach that solves directly for real and mirror virtual notional sources. The improved performance and stability are demonstrated with a field data example.