Modeling the dielectric functions of silicon-based films in the amorphous, nanocrystalline and microcrystalline regimes