Could you please help me with the following problem:

The model has 4 endogenous shocks that follow VAR(1): x_{t} = P x_{t1} + eps_{t}. I would like to estimate matrix P and lower triangular matrix Q to ensure that estimate of Sigma = QQ’ is positive semidefinite, where Sigma is a variancecovariance matrix of the error term.
(I don’t know how to use syntax of Dynare to state that Sigma is lower triangular and estimate values of Q) 
Also I would like to have an option to put elements P(4,1:3), P(1:3,4), Q(4,1:3) and Q(1:3,4) and estimate the rest elements of the P and Q.
I will really appreciate if you can explain how to do it with ML and Bayesian in Dynare.
Thank you.