Description Usage Arguments Details Value
View source: R/bd_calc_decay_time_from_peak.R View source: R/bd_calc_relative_density.R
For each sample, calculate the time it takes for the density to decrease by half from the peak
Calculate the relative density at two dates (or a range of dates / the peak)
1 2 3 | bd_calc_relative_density(soln, spec1, spec2, ind = NA, anal = NA)
bd_calc_relative_density(soln, spec1, spec2, ind = NA, anal = NA)
|
soln |
The result of a call to bd_do_inference |
spec1 |
The specification for the first density (see details) |
spec2 |
The specification for the second density (see details) |
ind |
(Optional) Indices at which to do the calculation. By default, all the samples in anal are used. |
anal |
The result of a call to bd_analyze_soln |
propChange |
(Default 0.5) The proportional |
anal |
(Optional) The result of a call to bd_analyze_soln. This is only needed if either spec1 or spec2 is 'peak' |
soln |
The result of a call to bd_do_inference |
anal |
The result of a call to bd_analyze_soln |
spec2 |
The specification for the second density (see details) |
ind |
(Optional) Indices at which to do the calculation. By default, all the samples in anal are used. |
anal |
(Optional) The result of a call to bd_analyze_soln. This is only needed if either spec1 or spec2 is 'peak' |
Calculate the relative density for two dates or, more generally, for two
Calculate the relative density for two dates or, more generally, for two different specifications of the density aside from a simple date. The additional specifications that are supported are the peak value and the mean density on an interval. For a simple date, spec1/spec2 should be scalar real numbers. For a date range, spec1/spec2 should be real vectors with a length of 2. For the peak, spec1/spec2 should be the string 'peak'.
By default, this calculation is done for all the Bayesian samples in soln, which is the result of a call to bd_do_inference. Optionally, a subset can be specified via the input ind, which should be a vector of integer indices at which to do the calculation. To save computation if either spec1 or spec2 is 'peak', the result of a call to bd_analyze_soln for which doSummary was T can be input.
A vector of relative densities (f_spec1 / f_spec2)
A vector of relative densities (f_spec1 / f_spec2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.