Umm, as a insurance and curiosity look up some Rene Descartes stuff, something along the line "I think, therefore I am".
As for your question, It existed because you seen it, it doesn't have to be real. Even it it was just a hallucination, it existed in the reality of your mind. It doesn't have to be in the world you are living in. Something like Idealism and parellel world kinds stuff. Im just trying to remember things from my philosophy class which I have forgotten in context. Ugh, why did I lose my notebook.
Im gonna try not to go as deep this time. Ghosts, yes it could be real but it can be a hallunination of the mind trigger by a statement, "This house is haunted." Your mind might end up creating illusions of ghost or weird flying things even though the house isn't haunted because you were made to think the house is. See?
All in all, it is you who decide (with your rational thinking) to make what is real...or believe it.