-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathgbinit.m
28 lines (26 loc) · 912 Bytes
/
gbinit.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function nmin = gbinit(q,r,s)
%GBINIT Initial iterations for Gibbs iteration diagnostic
%
% nmin = gbinit(q,r,s) returns number of
% initial iterations needed for estimating how
% many additional iterations are needed for
% given precision.
%
% The definition of the precisions parameters:
%
% "Suppose that U is function of theta, which is the
% parameter to be estimated. We want to estimate
% P[U <= u | y] to within +-r with probability s.
% We will find the approximate number of iterations
% needed to do this when the correct answer is q."
%
% Use q=0.025, r=0.005, s=0.95 if you are unsure.
%
% See also
% GBITER
%
% Copyright (C) 1999 Simo Särkkä
% This software is distributed under the GNU General Public
% Licence (version 3 or later); please refer to the file
% Licence.txt, included with the software, for details.
nmin = round(norminv((s+1)/2)^2*q*(1-q)/r^2);