Dear Stephen,
If you look at the source of VBOOTSTRAP or VCRITICAL you will get the method of how to do this
(use Help | Procedure Source and select VBOOTSTRAP).
You need to iterate some extra times and stop when you have the required number
of successful simulations. You turn off stopping for faults and then check the exit codes
and any faults set by Genstat. The explanation of the key steps is here:
SCALAR i,nonconverg; VALUE=0 "Number of successes and failures"
CALC maxnboot = NBOOT + NRETRIES
FOR [NTIMES=maxnboot; INDEX=k]
SET [DIAGNOSTIC=*; FAULT=*] "Turn off stopping for faults and clear any fault code"
FIT ... "Fit your model"
RKEEP EXIT=lastexit "Get exit code"
SET [DIAGNOSTIC=fault] "Turn on stopping for faults back on"
"Check for any error that has not set EXIT parameter to nonzero value"
GET [FAULT=Fault]
IF Fault .nes. ' ' .AND. lastexit == 0
CALC lastexit = -3
ENDIF
IF lastexit == 0
CALC i = i + 1
CALC Sim$[i] = ... "Save results from this simulation"
ELSE
CALC nonconverg = nonconverg + 1
ENDIF
EXIT [CONTROL=for] i == NBOOT "Stop when we have enough successes"
ENDFOR
There is also the SET [ACTIONAFTERFAULT=continue] option which will give
the fault messages and continue the for loop. The advantage of using the
SET [DIAGNOSTIC=*] is that the fault messages are suppressed.
Regards, David.
______________________________________________
Dr David Baird Statistical Consultant and Genstat Developer
VSN (NZ) Limited ([log in to unmask])
79 Ravensdale Rise, Westmorland , Christchurch 8025, New Zealand
Cell phone +64 21 1160803
From: GENSTAT-Request <[log in to unmask]>
On Behalf Of Stephen Senn
Sent: 23 December 2020 2:19 AM
To: [log in to unmask]
Subject: Carrying on despite a fault
I am running a simulation in which I am carrying out a logistic regression for the proportional odds model. Every now and then it stops because it predicts a negative probability. I should like the program to simply ignore the result and proceed with the next simulation. Is there an easy way to do this?
Stephen Senn
Please note new email
Stephen Senn
Tel +44 (0)7811166929
To unsubscribe from the GENSTAT list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=GENSTAT&A=1
To unsubscribe from the GENSTAT list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=GENSTAT&A=1
To unsubscribe from the GENSTAT list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=GENSTAT&A=1