Edge guarding marth: Depends on how far back he is from the edge, imo. . . .
TL;DR (short) version - the amount invincibility frames you get from ledge seems to underestimated and should be maximized to cover a lot of marth's recovery options.
Simply, try getting on the edge either RIGHT before marth gets to the ledge, himself, forcing him to go underneath or, if he's already underneath the stage and right before you think he will start his upb. Both of which w/o getting hit, yourself. Try different things out to actually see how many invincible frames you get/what you can do with them
Long version:
I like to try to treat it like it's a flowchart
if he's at a medium-far distance and coming in mid-highish, and he's far enough back to where a dj wont get him the edge, i like to fullhop backwards a bit and react to a sideb. once you see one you can ff bair him on reaction before he has a chance to do anything and finish the stock.
If he doesnt go for sideb (or suspects you for gimping him for sideBing), I still do the fh back and then dj back to the edge AFTER he gets to the point where he's too low to dj fair you from doing that.
A lot of the time, they'll try dj hitting you from taing the ledge, after that point, most middish marths will semi-panic upb if they tried hitting you with fair (and missed), in which case staying on the edge will give you enough invincibility frames to wait it out and act accordingly. If they sideb again, you can either hold on for dear life and react getup when they upb and it looks like theyre gonna get on the stage, or you can push away form the edge and bair them->quick dj to catch them by surprise (dont do this too much to the point theyre expecting it). And if they dont side b and continue to go down, you hold on and react roll once it gets to the point where they look like theyre too low to fully get on the ledge.
Now, if they dont dj, I'll switch up betweenfalling off with a bair, or doing a haxreset((push away from ledge, jump, and then di back to edge) as it protects you from getting hit from an early upb moreso than a regular reset)/normal reset and then seeing how they react to it, hoping that they upb as soon as I get my invincibility back.
I wont go into as much detail when the marth is recovering and he's pretty close, but you basically want to try geting under to uair him if he's high (especially after he uses a dj) and trying to sneak in grabbing the edge, right before he gets on the edge himself, to use your invincibility frames to get him to upb early on the ledge so you can dair->reverseknee or get him to go low enough so you can edgehog n stuff.
Plus, there's a small window where the marth is below the stage where, at that moment, if he upbs, you can roll on stage to edgehog him and have enough time to run back and grab him if he lands on stage before he can do anything