I am as mad as he,
If sad and merry madness equal be.

– William Shakespeare

Twelfth Night, Act 3, Scene 4. Olivia is herself identifying with the madness of Malvolio, who is acting weirdly after being duped by the fake love letter he thinks is from her. Her madness is her unrequieted love for Cesario (Viola), which has left her melancholic.