Does running a relay improve your anonymity when using Tor?

Running a relay can increase your anonymity against some attacks, but it also carries risks and trade-offs that depend on your threat model.