It is narrated from Hazrat Mughirah bin Shu’bah (may Allah be pleased with him) that he said: The rider should follow behind the funeral, and the one walking on foot has the choice (to go ahead or behind, to the right side or to the left side). And the funeral prayer will be offered for a miscarried child, in which forgiveness and mercy will be supplicated for his parents. Yunus says that the family of Ziyad narrate it from the Prophet (peace and blessings be upon him), but I do not remember it that way.
Hadith Referenceمسند احمد / أول مسند الكوفيين / 18181