likelihood write to file