It depends on your state laws and whether you have a castle doctrine in effect and also whether the intruder is just attempting to steal or actually intends to kill you. The further you let an aggressor into your house, the more like you are to be injured. Once inside, they also have cover similar or equal to your's. While you are confined to an upstairs bedroom all they have to do is get directly below you on the lower level and fire up through the floor you're standing on. If you feel it's likely the aggessor(s) are going to cause you bodily harm, a more proactive defense would be advisable.
This is pretty much universally accepted as bad advice. If you are passing along advice that was given to you then you should carefully consider any other advice from the same source. If this is advice you formulated on your own then please rethink this position and/or get some real professional training. There is a high likelyhood you will be killed or injured doing this and nobody here would want that for you.
This course of action puts you in the greatest peril possible under the most likely robbery/home invasion scenario. Unless the perp has absolutely located you, which would mean you were not at all stealthy, or if the perp has done something rash like setting your house on fire or armed a bomb, staying put and on guard is your best hope for success. Even if this is someone who means you harm and knows your home's layout, you are still better off laying in wait rather than actively seeking the perp.