# Plot normal distribution with unknown mean that is normally distributed with known parameters

3 Ansichten (letzte 30 Tage)
Skou Ntouf am 6 Apr. 2017
Beantwortet: Thorsten am 7 Apr. 2017
How can I use Matlab to plot a univariate normal distribution when it has unknown mean but the mean is also normally distributed with known mean of mean and variance of mean?
Eg. N(mean, 4) and mean ~N(2,8)
##### 1 Kommentar-1 ältere Kommentare anzeigen-1 ältere Kommentare ausblenden
David Goodmanson am 7 Apr. 2017
Hi Skou, you have not specified the variance of the normal distribution itself. Is it a standard normal with variance 1?

Melden Sie sich an, um zu kommentieren.

### Akzeptierte Antwort

Thorsten am 7 Apr. 2017
2 + 8*randn(1, 100) + 4*randn(100,1);
or in more detail
n = 1; m = 100; % number of samples
m1 = 2; s1 = 8; s2 = 4;
m2 = m1 + s1*rand(n, m);
X = m2 + s2*rand(n, m);
##### 0 Kommentare-2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

### Kategorien

Mehr zu Exponential Distribution finden Sie in Help Center und File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by