Could be many things. Things I know that can cause this are sensors failing (especially crank position sensor), iffy coils or coil packs, depending on whats fitted, or fuel vapour locks. This list is not exhaustive. Has it been regularly serviced/high mileage? You may wish to consider changing the plugs and ht leads as well if separate from the coils. If its low mileage/well looked after then go for the sensor if fitted.