In a large bowl, whisk together the flour, baking powder, baking soda, cinnamon, ginger, nutmeg, allspice and salt. Set aside.
In the bowl of a stand mixer fitted with the paddle attachment, beat the butter, granulated sugar and brown sugar together until light and fluffy.
Add the eggs to the butter mixture, one at a time mixing well after each addition.
Turn the mixer on low. Stir in the vanilla and carrots.
Slowly add the flour mixture to the wet ingredients, then the raisins and pecans.
Fill each muffin well lined with a cupcake liner 3/4 full with the batter.
Bake at 400 degrees for 10 minutes, then reduce the heat to 325 and continue baking for 20 minutes or until a toothpick inserted into the center comes out clean.
Transfer to a cooling rack and cool completely.
Make the Cream Cheese Frosting:
Add the butter and cream cheese to the bowl of a stand mixture fitted with a paddle attachment. Beat on medium speed until light and fluffy.
Slowly add the sugar to the cream cheese mixture beating until light and creamy. Stir in the vanilla.
Transfer the frosting to a piping bag and frost the cupcakes, as desired. Sprinkle with chopped pecans and serve.
Notes
Cupcakes can be made up to 24 hours in advance and stored in an airtight container at room temperature. Frosting can be made up to 3 days in advance and stored in an airtight container at room temperature.