help mata rtnorm()
-------------------------------------------------------------------------------

Title

rtnorm() -- Truncated normal pseudorandom variates.

Syntax

real matrix rtnorm(real scalar r, real scalar c,real rowvector m,real rowvector s, real rowvector lower, real rowvector upper)

Description

rtnorm(r,c, m, s, lower, upper) returns an r x cj real matrix containing truncated normal random variates. The real-valued rowvectors m and s contain the mean and standard deviation parameters before truncation, respectively. The real-valued rowvectors lower and upper contain parameters defining the two-sided truncation of the distribution. The matrices m,s,lower and upper must be c-conformable.

Conformability

rtnorm(r,c, m, s, lower, upper): r: 1 x 1 c: 1 x 1 m: 1 x 1 or 1 x j s: 1 x 1 or 1 x j lower: 1 x 1 or 1 x j upper: 1 x 1 or 1 x j result: r x c or r x cj

Diagnostics

The random-variate generator abort with error if r<=0 or c<=0.

rtnorm(r,c, m, s, lower, upper) abort with an error if the parameter rowvectors do not conform. See c-conformable for rules on matrix conformability.

Author

Federico Belotti Faculty of Economics Department of Financial and Quantitative Economics Tor Vergata University federico.belotti@uniroma2.it

Giuseppe Ilardi Economic and Financial Statistics Department Bank of Italy

Also see

Manual: [M-5] runiform()

Help: [M-4] standard, [M-4] statistical