ผลต่างระหว่างรุ่นของ "Nested sampling manual"
Jung (คุย | มีส่วนร่วม) |
Jung (คุย | มีส่วนร่วม) |
||
(ไม่แสดง 5 รุ่นระหว่างกลางโดยผู้ใช้คนเดียวกัน) | |||
แถว 53: | แถว 53: | ||
== Default values of parameters: the details == | == Default values of parameters: the details == | ||
− | Let <math> M | + | ===<math>Niter</math>=== |
+ | Let <math> M \, </math> be the mass of the <math>D\,</math>-dimensional parameter space and let <math> m \, </math> be a mass defined by a typical set with respect to a given posterior. Typically, when <math> D \, </math> increases, <math> m/M \, </math> converges to zero exponentially fast. Moreover, when we integrate over all parameter space with respect to the posterior, only this fraction of parameters contributes a value in the integral result. | ||
+ | |||
+ | Thus, the iteration of nested sampling, <math> Niter \, </math> must be high enough for nested sampling to reach this region. Since for each iteration, the mass '''on average''' is reduce by the factor <math> \frac{Next}{Next + 1} \, </math>, we have | ||
+ | |||
+ | <math> | ||
+ | \left(\frac{Next}{Next + 1} \right)^{Niter} = \frac{m}{M}. | ||
+ | </math> | ||
+ | |||
+ | Using the approximation <math> 1 + x \approx e^x </math>, we have | ||
+ | |||
+ | <math> | ||
+ | Niter \approx Next \cdot \log \frac {M}{m}. | ||
+ | </math> | ||
+ | |||
+ | Assuming we face the worst case, <math> D^{-D} </math> is a reasonable value for <math>m/M</math> so that we have | ||
+ | |||
+ | <math> | ||
+ | Niter \approx Next \cdot D \log D. | ||
+ | </math> | ||
+ | |||
+ | |||
+ | === <math>Next</math> === | ||
+ | Assume first that we fix <math> Next\, </math> to some positive integer. | ||
+ | |||
+ | Let <math> x_i \, </math> be a random variable of a ''shrinked mass'' for each iteration <math> i = 1, 2, ... </math>. According to nested sampling procedure, each <math> x_i \, </math> is an ''extreme value'' random variable with degree <math> Next</math>. Up to <math> I^{th}\, </math> iteration, the mass <math> M\, </math> is shrinked by <math> \prod_{i=1}^I x_i </math>. Taking logarithm, the log of remaining mass is <math> \log M + \sum_{i=1}^I \log x_i </math>. | ||
+ | |||
+ | Define <math> I^* = Next \cdot \log \frac{M}{m}\, </math> so that | ||
+ | |||
+ | <math> | ||
+ | E[\sum_{i=1}^{I^*} \log x_i] = \log \frac{m}{M}. | ||
+ | </math> | ||
+ | |||
+ | Since each <math> x_i \, </math> is independent, we have | ||
+ | |||
+ | <math> | ||
+ | Var[\sum_{i=1}^{I^*} \log x_i] = \sum_{i=1}^{I^*} Var[ \log x_i] = \frac{I^*}{(Next)^2}. | ||
+ | </math> | ||
+ | |||
+ | By a usual estimation (<math> x = \mu \pm 3\sigma </math>), we have | ||
+ | |||
+ | <math> | ||
+ | \sum_{i=1}^I \log x_i \approx \log \frac{m}{M} \pm 3\sqrt{\frac{\log \frac{M}{m}}{Next}}, | ||
+ | </math> | ||
+ | |||
+ | or, with high probability, | ||
+ | |||
+ | <math> | ||
+ | \prod_{i=1}^I x_i \in \left[ \frac{m}{M} \div \exp \left(3\sqrt{\frac{\log \frac{M}{m}}{Next}} \right) , \frac{m}{M} \times \exp \left(3\sqrt{\frac{\log \frac{M}{m}}{Next}} \right) \right] | ||
+ | </math> | ||
+ | |||
+ | Define <math>\gamma = \exp \left( 3\sqrt{\frac{\log \frac{M}{m}}{Next}} \right)</math> be a stability factor specified by user (e.g. I use <math> \gamma = 1.25 </math>) and rearrange the equation we get | ||
+ | |||
+ | <math> | ||
+ | Next = \frac{9 \log \frac{M}{m}}{ (\log \gamma)^2}. | ||
+ | </math> | ||
+ | |||
+ | Finally, pessimistically estimate <math>m/M</math> by <math>D^{-D}</math> and use <math>\gamma = 1.25</math> we get | ||
+ | <math> Next \approx 144 D \log D </math>. So this is why I set <math> Next </math> to <math> 150 D \log D </math>. | ||
+ | |||
+ | === <math>Nwalk</math> === | ||
+ | The default value of <math>D \log D</math> for <math>Nwalk</math> is adhoc. I try to make the total time complexity of nested sampling be comparable to that of ''MCMC methods for computing the volume of convex body'', e.g. the work of Lovasz and Vempala (2003). | ||
==References== | ==References== | ||
แถว 61: | แถว 122: | ||
* Ramussen (2003). Bayesian Statistics 7. | * Ramussen (2003). Bayesian Statistics 7. | ||
* Gelman et al. (1996). Efficient Metropolis Jumping Rules. Bayesian Statistics 5. | * Gelman et al. (1996). Efficient Metropolis Jumping Rules. Bayesian Statistics 5. | ||
+ | * Lovasz and Vempala (2004). Simulated Annealing in Convex Bodies and an O(n^4) Volume Algorithm. [http://citeseer.ist.psu.edu/673703.html link] |
รุ่นแก้ไขปัจจุบันเมื่อ 12:32, 10 เมษายน 2550
เนื้อหา
Introduction
Generally, nested sampling is used for calculating any integrals, e.g. an evidence in Bayesian model selection problems. This program will concentrate only on the problem of selecting the number of components in a Mixture of [Spherical] Gaussians (MOGs) given observed data. In this problem, the likelihood is a product of MOGs, and we assume that the prior is uniform (or truncated-log-uniform for the deviation parameter) over the parameter space.
NOTE for Oli
To test the correctness of our implementations, I also provide a simple MOGs likelihood for us [see (1.2) below]: a mixture of three spherical gaussian with , so that the integral result will be where is the number of dimensions in the parameter space.
Program parameters
Main parameters
Normally, Nested sampling is controlled by 4 main parameters:
(no default value)
This defines the number of dimensions of the parameter space .
- In our problem of learning (spherical) MOGs, where is the dimension of the data space; To visualize the result, I usually use ;
- (** just for developers**) if the likelihood is a simple MOG, I define . (see (6.2))
(default = )
The degree of extreme value distribution (Skilling, 2006; eq.(17)). This is the number of initial points for each nested sampling iteration which we can use to solve the problem of sampling from a truncated prior (My MCMCMC paper). This number also controls stability of nested sampling (greater --> more stable).
(default= )
The so-called burn-in parameter in MCMC literatures. This parameter is used to solve the problem of sampling from a truncated prior.
(default= )
The (estimated) maximum number of nested sampling iterations.
Minor parameters
test_likelihood (default [undefined])
If define, the program will switch the likelihood to a simple mixture of spherical gaussians (explained above).
walk (default 1)
determine the type of random walk
- walk = 1, use slice sampling with hyperrectangle (Neal, 2003; section 5.1)
- walk = 2, use metropolis-hasting sampler with GP-proposal (our project)
{ if (walk = 2) } (no default)
we have to define this number. This defines the number of pseudo-walk using GP as an approximation of the real likelihood.
Default values of parameters: the details
Let be the mass of the -dimensional parameter space and let be a mass defined by a typical set with respect to a given posterior. Typically, when increases, converges to zero exponentially fast. Moreover, when we integrate over all parameter space with respect to the posterior, only this fraction of parameters contributes a value in the integral result.
Thus, the iteration of nested sampling, must be high enough for nested sampling to reach this region. Since for each iteration, the mass on average is reduce by the factor , we have
Using the approximation , we have
Assuming we face the worst case, is a reasonable value for so that we have
Assume first that we fix to some positive integer.
Let be a random variable of a shrinked mass for each iteration . According to nested sampling procedure, each is an extreme value random variable with degree . Up to iteration, the mass is shrinked by . Taking logarithm, the log of remaining mass is .
Define so that
Since each is independent, we have
By a usual estimation (), we have
or, with high probability,
Define be a stability factor specified by user (e.g. I use ) and rearrange the equation we get
Finally, pessimistically estimate by and use we get . So this is why I set to .
The default value of for is adhoc. I try to make the total time complexity of nested sampling be comparable to that of MCMC methods for computing the volume of convex body, e.g. the work of Lovasz and Vempala (2003).
References
- My MCMCMC paper.
- Skilling (2006). Bayesian Statistics 8.
- Neal (2003). Slice sampling (with discussions). Annals of Statistics.
- Ramussen (2003). Bayesian Statistics 7.
- Gelman et al. (1996). Efficient Metropolis Jumping Rules. Bayesian Statistics 5.
- Lovasz and Vempala (2004). Simulated Annealing in Convex Bodies and an O(n^4) Volume Algorithm. link