Tuning the magnetism of ferrite nanoparticles