Description Usage Arguments Details Value Author(s) References See Also Examples
High-resolution BSA which identifies the highest peak and samples more finely in its vicinity.
1 | BaSAR.fine(data, start, stop, nsamples, nbackg, tpoints)
|
data |
data as a 1-dimensional vector |
start |
lower limit of period of interest, in seconds |
stop |
upper limit of period of interest, in seconds |
nsamples |
number of samples within the interval start-stop |
nbackg |
number of background functions to be added to the model |
tpoints |
vector of time points, in seconds |
BaSAR.fine
combines the function BaSAR.post
with a Downhill-Simplex optimizer to identify the maximum peak in the frequency range chosen. It then samples over a narrower range around this peak for a high-resolution estimate of the strongest frequency. See e.g. Press (2002) for an example of Downhill-Simplex optimization.
A list containing:
normp |
1D normalized posterior distribution over omega |
omega |
1D vector of the omega sampled |
stats |
list of statistics from the probability distribution |
Emma Granqvist, Matthew Hartley and Richard J Morris.
Granqvist, E., Oldroyd, G. E. and Morris, R. J. (2011) Automated Bayesian model development for frequency detection in biological time series. BMC Syst Biol 5, 97.
http://dx.doi.org/10.1186/1752-0509-5-97
Press, W. H. (2002) Numerical recipes in C++: the art of scientific computing, 2nd Edition. Cambridge, UK: Cambridge University Press.
1 2 3 4 5 6 7 8 9 10 11 12 | # Create time series with omega = 0.5 and add noise
tpoints = seq(from=1, to=200, length=200)
r1 = rnorm(200, 0, 1)
r2 = rnorm(200, 0, 1)
dpoints = sin(0.5 * tpoints + 0.1 * (0.5-r1)) + 0.7 * r2
# Plot time series
plot(dpoints, type="l", col="blue", xlab="t", ylab="d(t)")
# Run BaSAR
r = BaSAR.fine(dpoints, 6, 600, 100, 0, tpoints)
# Plot the resulting probability density function around maximum peak
plot(r$omega, r$normp, xlim=c(0:1), type="h", col="red", ylab="PDF",
xlab=expression(omega))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.