Is there a way to constrain a matrix in Stan to be full rank?

Thanks!

Is there a way to constrain a matrix in Stan to be full rank?

Thanks!

An unconstrained matrix is almost certainly full-rank. What’s the use case you’re thinking of?

I am running into system identification problems and I want to guarantee observability and controllability. As one solution, I need to use orthogonal matrices. For example in the following model, I need the matrix C to be orthogonal:

\mathbf{\theta} \sim \mathcal{N}(\mathbf{C} \mathbf{x},\mathbf{R}) \\

I tried QR decomposition, but it made things only worse.