Used in casual or informal situations, not in serious discussions or formal writing. In that casual debate, Andy started talking through his hat about quantum physics.
Pro Tip 2/3
Credibility at Risk
Using this expression may imply that the speaker's knowledge or credibility is questionable. If you keep talking through your hat, no one will take your arguments seriously.
Pro Tip 3/3
Critical Listening
Be skeptical when someone seems to be talking through their hat; they might be misinformed. She sounded confident, but I suspect she was just talking through her hat.