Traditionally, it's kinda random. There is a way of cheating it, however. This has worked for me, and it might for you, but it's a little destructive on your normal life, and it goes as follows...
Get an alarm clock. If you already have one, get a new, cheap, one. Trust me on this.
Brace yourself with a drink or two, because what you are about to do goes against much of what you stand for, and if it doesn't, it should do, damnit.
*deep breath*
Deliberately, and with malice and forethought, set an alarm clock to wake you up at 2am.
See? That wasn't too difficult, was it?
Was it? Good, it should be. That was the difficult bit, after that it's just willpower.
For a while, go to bed at 10ish, so you are probably deeply, REM style, asleep by 2am when the alarm wakes you up. At that point you do the following:
Wake up.
Swear.
Aim a few choice words at the geek who told you to do this.
turn off the blasted noise.
Go back to **82** again.
After a while (Weeks, Months, the longer you do this for the better it works), and on a Saturday, take the alarm clock to a place of safety and apply an extremely large mallet to it. Smashing things that wake you up at 2am is immensely satisfying, and would be worth it even if it were not for the next bit.
Continue on your new **82** cycle, and around 2am your brain will start to think "Bollocks, I'm about to be woken up, better prepare" and you will probably go into a lucid dream state, which you is not - as your brain expects it to be - interrupted by the loud noise.
Use this time to fly, explore your psychological state, find a deeper meaning of life, or inflate the breasts of nice-looking females to incredible proportions at your whim.
'sup to you, really.