As long as you aware that the friend is imaginary, perhaps. If it gets to real, I'd say it is a mental illness.
Not sure if you can simply create that by willpower/meditation, though. Although it seems very likely that it is possible to deliberately fuck up one's mental health. After all, it is possible to fuck up one's physical health, too.