[NMusers] Re: Random number generation
Thanks Tingjie for your suggestion
Unfortunately, as is, the suggested code is rejected by NONMEM 7.3 if used in $ERROR. Some additional setup calls might be required.
An (admittedly heavy-handed) alternative that actually works is to create and import a fortran routine (see NONMEM help topic about FUNCA, or VECTRA).
USE SIZES, ONLY: DPSIZE
REAL(KIND=DPSIZE) :: X,X1,X2,FUNCA
FUNCB = RAND()
$SUBROUTINES ADVAN_ TRANS_ OTHER=runif.f90
VECTRA(1) = 0
VECTRA(2) = 0
VECTRA(3) = 0
RND = FUNCA(VECTRA)
From: "Tingjie Guo" <iam_at_tingjieguo.com>
To: "Sebastien Bihorel" <sebastien.bihorel_at_cognigencorp.com>, nmusers_at_globomaxnm.com
Sent: Monday, June 3, 2019 12:58:56 PM
Subject: Re: Random number generation
As far as I know, you could write verbatim code to generate random numbers during estimation. E.g:
RAN = any value ; initialization
"RAN = RAND(0) ; start verbatim code
A random number between 0 and 1 from uniform distribution will be assigned to RAN. This function is called for each record of your input data. I believe it's also possible to call it more/fewer times through checking ICALL.
From: owner-nmusers_at_globomaxnm.com <owner-nmusers_at_globomaxnm.com> on behalf of Sebastien Bihorel <sebastien.bihorel_at_cognigencorp.com>
Sent: Thursday, May 30, 2019 12:34
Subject: [NMusers] Random number generation
Is it possible for NONMEM to generate a random number during an estimation run?
Received on Mon Jun 03 2019 - 16:54:46 EDT
This archive was generated by hypermail 2.3.0
: Fri Sep 27 2019 - 17:05:09 EDT