Description Usage Arguments Author(s) Examples
Randomly generate a set of 'feasible' parameter sets describing distribution of Z_a and Z_d, used for initiating E-M algorithm. pi2 is drawn such that log10(pi2) has a uniform distribution with max. value 5, min. value 1. Values of pi2>0.1 are not expected, and 10^-5 is a low enough prior to initialise the EM algorithm if the true value is smaller than this. pi1 is drawn from either U(0.3,0.7) or such that log10(pi1)~U(1,3), the first with probability p_reg sigma_1 and tau are either 1 or drawn such that sigma_1^2~U(1,10) sigma_2 is either 1 or drawn such that sigma_1^2~U(1,10) rho is either 0 or U(0.05,0.95)*sigma_2*tau
1 |
N |
number to generate |
H |
hypothesis; 0 or 1. Under H=0, sigma2 is forced to 1 and rho to 0. |
p_reg |
probability that pi1 is U(0.3,0.7), sigma_1=1, sigma_2=1, tau=1, rho=0 |
seed |
random seed for generating results; use to regenerate. |
James Liley
1 2 3 4 5 6 7 8 9 | px=pars_rand()
par(mfrow=c(2,3))
plot(density(px[,2],from=0,to=1),main="pi1") # distribution of pi1
plot(density(log10(1-px[,1]-px[,2]),from=-5,to=-1),main="log10(pi2)") # empirical distribution of log10(pi2)
plot(density(px[,3]),main="tau") # empirical density of tau
plot(density(px[,4]),main="sigma1") # empirical density of sigma1
plot(density(px[,5]),main="sigma2") # empirical density of sigma2
plot(density(px[,6],from=0),main="rho") # empirical density of rho
par(mfrow=c(1,1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.