A comparison between electrocaloric and magnetocaloric materials for solid state refrigeration