# Conditional Normal Random Distribution

18 views (last 30 days)

Show older comments

I want to generate a random vector (a) from a normal distribution N(mu,sigma) (mu,sigma:known) with a condition that the first n values of vector 'a' are known and fixed (basically its fulfilling boundary conditions).

Is there any way I can use Multivariate normal random numbers function: R = mvnrnd(mu,Sigma) or any other method?

##### 0 Comments

### Accepted Answer

Paul
on 19 Aug 2021

##### 10 Comments

Paul
on 23 Aug 2021

I didn't provide an example, so I'm still not sure what you've compared to your code.

Instead of reindexing your problem to fit the formula, it's probably easier to modfiy the formula to fit your problem. Just reverse the 1's and 2's.

mubar = mu2 + Sigma21/Sigma11*(a - mu1);

Sigmabar = Sigma22 - Sigma21/Sigma11*Sigma12;

Feel free to come back if you have any more questions, particularly if you want to post your code with an example. However, if you do, don't use a 10-element vector in the example. Maybe use a 3-element vector X and show the mubar and Sigmabar of X(3) given known values of X(1) and X(2).

### More Answers (0)

### See Also

### Categories

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!