Funny you should ask that question. I was just reading the manual for the ones I have, and it says that the detector should be placed in the center of the ceiling of the room, but if not practical, that it be mounted no closer than 100 mm (4 in.) to any wall or corner.
It also states that if local code allows for the detector to be mounted on a wall, that it be located between 100 mm and 300 mm (4 in. and 12 in.) from the wall/ceiling intersection.
Ours are the photoelectric type, but I don't think the type should make a difference for mounting.