signed_bernoulli2(N,p1,p2,r)
The function first constructs two(2) signed {-1, +1} Bernoulli variables Y_1, Y_2 such that p(Y_1 = -1) = p1, p(Y_2 = -1) = p2, and E[Y_1Y_2] = r. Constraints: 0 < p1,p2 < 1, -1 < r < 1. Next, it draws N realizations of the two variables in Y(m,:), m = 1,2. The sample pdf and cross correlation converge as N -> infinity (obviously).
Example: generate N realizations of variables with mean 0, variance 1, and correlation 0.3: Y = signed_bernoulli2(N,0.5,0.5,0.3).
Zitieren als
Aravindh Krishnamoorthy (2026). signed_bernoulli2(N,p1,p2,r) (https://de.mathworks.com/matlabcentral/fileexchange/65164-signed_bernoulli2-n-p1-p2-r), MATLAB Central File Exchange. Abgerufen.
Kompatibilität der MATLAB-Version
Plattform-Kompatibilität
Windows macOS LinuxKategorien
Tags
Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
| Version | Veröffentlicht | Versionshinweise | |
|---|---|---|---|
| 1.0.0.0 |
