Suppose I want to generate a $n \times n$ orthogonal matrix $H$ (that is, $H^T H=I$) but with the property that $1-e < (tr H)/n < 1+e$ for some pre-specified tolerance $e$. How can I do this? Ideally I would want them to have the Haar distribution (conditional on the trace restriction) but I would settle for any method that produces a "reasonable" distribution.

Two approaches I had in mind:

1) use of Givens rotations/Euler angles close to 0

2) (edited) using skew-symmetric matrices $L$ close to 0 and evaluating $\exp L$

NOTE: Possible applications include Bayesian estimation of covariance matrices.

  • 2
    $\begingroup$ Do you mean $(1-e)n$ and $(1+e)n$ by chance? Or, something else? $\endgroup$
    – cardinal
    Mar 30, 2012 at 16:12
  • 3
    $\begingroup$ I like option (2) and believe it will be quite stable for $|\epsilon|\lt 1$--just look at how the terms in the power series decay. The issue is working out the correct probability distribution. For really small $\epsilon$ you can take it to be uniform (on the Lie algebra) but for larger values curvature will begin to matter, and then you have to work out the Jacobian of the exponential map, as done on MO for skew-symmetric matrices. $\endgroup$
    – whuber
    Mar 30, 2012 at 16:16
  • $\begingroup$ Thanks whuber! I also think the exponential approach looks promising (and easy to implement!) $\endgroup$ Mar 31, 2012 at 1:07

1 Answer 1


I asked a related (but not identical) question on MathOverflow and got responses that are similar to what you suggest here. However, the paper I cite in my answer there gives a distribution on O(p) with a dispersion parameter that controls how concentrated samples will be around the identity. This isn't exactly what you ask for, but it might be a useful alternative depending on how flexible your requirements are.

  • $\begingroup$ Great! Actually, this is perfect for my purposes $\endgroup$ Mar 31, 2012 at 0:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.