I am reading Leviticus, and am genuinely confused about the use of the phrase: 

"I am the Lord [your God]".

This phrase is added to the end of various instructions, seemingly at random. Is there any explanation for this, or logic to it?