Portia's father dies before the beginning of Shakespeare's The Merchant of Venice, but he left instructions to follow a particular method and procedure for deciding the man who will be her husband. Portia has no real choice in the matter, and the outcome is determined solely by which of three small caskets each of her suitor's chooses.
Portia seems to resent her father’s meddling in her life even after his death, and there's also a sense that she's not at all pleased that he didn't trust her to make her own decision about a husband.
PORTIA. [S]o is the will of a living daughter curbed by the will of a
dead father:—Is it not hard, Nerissa, that I cannot choose
one, nor refuse none?
(act 1, scene 2, lines 22–24)
There's no mention of any consequence to Portia if she doesn't follow her father's instructions—like losing her inheritance. Portia also doesn't give any reason for adhering to his wishes, even now that he's dead and can't interfere if she decides to choose a husband for herself.
Although there's precedent in Shakespeare's plays for dead fathers returning from the grave to haunt their children, it seems unlikely that any such ghost would appear in what is generally, and generously, categorized as a comedy, if for no other reason than it ends happily for most of the characters in the play except Shylock.
The audience must assume that Portia loved and respected her father enough to concede to his wishes even after his death, as patronizing and patriarchal as those wishes might be. She also appears to understand his desire for her to have a husband who loves her for herself, not only for her considerable wealth and beauty.
Portia complains bitterly to her lady-in-waiting, Nerissa, about her suitors, but Portia has cleverly devised how to "game the system" so that she can have at least some choice in the matter of her own husband.
Regarding the Duke of Saxony, for example, who Portia finds vile "in the morning, when he is sober, and / most vilely in the afternoon, when he is drunk," she has Nerissa put a glass of wine on one of the "contrary" caskets, so he will choose the wrong one.
PORTIA. Therefore, for fear of the worst, I pray thee, set a deep
glass of Rhenish wine on the contrary casket; for, if the
devil be within and that temptation without, I know he
will choose it.
(act 1, scene 2, lines 84, 87)
Portia has no interest in being married to someone who is, in her own words, "a sponge" (act 1, scene 2, line 88).
As for her other suitors, the Neapolitan prince "doth nothing but talk / of his horse," and the Palatine count "doth nothing but frown" (act 1, scene 2, lines 36–42). God made the French lord Monsieur Le Bon, Portia says, "and therefore let him pass for a man." And as for Falconbridge, the young English Baron, "he understands not me, nor I him" (act 1, scene 2, lines 49–62).
In any event, Bassanio, who is Portia's choice for a husband, agrees to participate in the three-casket game show, with Portia as the prize. He chooses the correct casket—notably, without any undue influence from Portia—and he succeeds in officially winning her hand, to go with her heart, which he already had won.
It might be that Portia's father understood her well enough to expect that she would try to "game the system" and that her own choice for a husband would be a good one. The result of the three-casket "test" simply serves to approve and support Portia's own decision, as if Portia's father were still alive to congratulate her on her choice himself.