Does it make sense to give a warning if effective rank is different from k? I was considering this when originally writing this function - up to you if you think it makes sense to add.