Yeah KirbyKaze pretty much summed it up as far as your edge-game vs. Marth's edgeguarding. The best way to fight Marth is centre stage. If you're on the edge of the stage and he knows how to properly space fairs while remaining patient to observe what you're going to come up from the ledge with so he can punish you, it'll eventually lead to you dying, and can become very frustrating. However, when you're fighting him centre stage it's easier to maneuver around his fair spacing with proper pill spamming and using the pills correctly. Not saying it's not hard to bypass his fair because it is very hard, but it beats being on the ledge with him just patiently waiting to punish you're get-up. Marth's that know how to play Doc. and that are good will space fairs because they know that one of you're best approaches is to pill space and then Decoy Vitamin towards them to get that grab.
QDVS is the main Marth that I play, and he's very, very good. He's in my crew so we play a lot and actually him and RockCrock are the ones that taught my brothers and I how to play this game when we first started. Usually he beats me when he plays patiently next to the ledge, fair spaces correctly and accordingly, and when he edgeguards with counter against my up+B/sweetspot because the trajectory just gays the hell out of Doc. and you can't really DI it. It sends you further out and since you've probably already done the recovery process you won't be close enough to the stage to up+B sweetspot. Not to mention he's probably going to be edgehogging by that time anyways. So if you see that a Marth is edgeguarding you with either patient fairs or is countering your up+B, it's obviously best to play centre stage no matter what. The best time to even play with the ledge/edge against Marth is of course when you're edge-guarding him, however I'd be careful when jumping off the stage to edge-guard him and do it only when you're certain of success, because if he turns it around so that he's now edge-guarding you because you screwed something up, you're in for one hell of a surprise of **** if he knows what he's doing.