Ahora está siguiendo esta publicación
- Verá actualizaciones en las notificaciones de contenido en seguimiento.
- Podrá recibir correos electrónicos, en función de las preferencias de comunicación que haya establecido.
% function X = TruncatedGaussian(sigma, range)
% X = TruncatedGaussian(sigma, range, n)
Generate a pseudo-random vector X of size n, X are drawn from the truncated Gaussian distribution in a RANGE braket; and satisfies std(X)=sigma.
RANGE is of the form [left,right] defining the braket where X belongs. For a scalar input RANGE, the braket is [-RANGE,RANGE].
If input SIGMA is negative, X will be forced to have the same "shape" of distribution function than the unbounded Gaussian with standard deviation -SIGMA: N(0,-SIGMA). It is similar to calling RANDN and throw away values ouside RANGE. In this case, the standard deviation of the truncated Gaussian will be different than -SIGMA. The *effective* mean and the effective standard deviation can be obtained by calling:
[X meaneffective sigmaeffective] = TruncatedGaussian(...)
Citar como
Bruno Luong (2026). Truncated Gaussian (https://es.mathworks.com/matlabcentral/fileexchange/23832-truncated-gaussian), MATLAB Central File Exchange. Recuperado .
Agradecimientos
Inspiración para: Truncated multivariate normal
Información general
- Versión 1.3.0.0 (3,46 KB)
Compatibilidad con la versión de MATLAB
- Compatible con cualquier versión
Compatibilidad con las plataformas
- Windows
- macOS
- Linux
