| | 1 | = PDAF_generate_rndvec = |
| | 2 | |
| | 3 | This page documents the routine `PDAF_generate_rndvec` of PDAF. It was added in PDAF V3.1. |
| | 4 | |
| | 5 | The routine returns a random vector with a specified distribution |
| | 6 | |
| | 7 | The interface is the following: |
| | 8 | {{{ |
| | 9 | SUBROUTINE PDAF_generate_rndvec(len, vec, stddev, dist, iseed) |
| | 10 | }}} |
| | 11 | with the following arguments: |
| | 12 | {{{ |
| | 13 | integer, intent(in) :: len ! Length of vector to perturb |
| | 14 | real, intent(inout) :: vec(:) ! vector to be perturbed |
| | 15 | real, intent(in) :: stddev ! Standard deviation of lognormal distribution |
| | 16 | integer, intent(in) :: dist ! Distribution: |
| | 17 | ! (1) Normal, N(vec, stddev^2) |
| | 18 | ! (2) Log-normal, logN(vec, stddev^2) |
| | 19 | ! (3) uniform: vec + stddev*U(0,1)) |
| | 20 | ! (4) uniform: vec + stddev*U(-1,1)) |
| | 21 | ! (5) Laplace |
| | 22 | integer, intent(in) :: iseed(4) ! Seed for dlarnv (last entry has to be odd) |
| | 23 | }}} |
| | 24 | |
| | 25 | **Note:** |
| | 26 | * The values of `iseed` are set by the user to control the random number generation. |
| | 27 | * PDAF's random number generation uses the LAPACK function DLARNV. |