Description Usage Arguments Details Value Author(s) See Also Examples
Calculates a normalised posterior over period range.
1 | BaSAR.plotperiod(omega,p)
|
omega |
1D vector of omega |
p |
posterior distribution over omega |
The other BaSAR functions return the posterior over omega (angular frequency). If the user wants to plot the result over period instead, this function takes the results from e.g. BaSAR.post
and computes the posterior over an evenly spaced vector of the period. This is done using linear interpolation of the posterior over omega.
A list containing:
period |
1D vector of the period (in seconds), evenly sampled |
normp |
normalised posterior distribution over |
omega |
1D vector of the omega, corresponding to |
Emma Granqvist, Matthew Hartley and Richard J Morris.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # Create time series omega = 0.5
tpoints = seq(from=1, to=200, length=200)
dpoints = sin(0.5 * tpoints) + 0.1 * rnorm(200, 0, 1)
# Plot time series
plot(dpoints, type="l", col="blue", xlab="t", ylab="d(t)")
# Run BaSAR to get normalized posterior distirbution
r <- BaSAR.post(dpoints, 6, 30, 100, 0, tpoints)
# Plot the resulting posterior density function
plot(r$omega, r$normp, xlim=c(0:1), type="h", col="red", ylab="PDF",
xlab=expression(omega))
# Calculate distribution over period interval 6-30 seconds
r2 <- BaSAR.plotperiod(r$omega,r$normp)
# Plot distribution over period instead
plot(r2$period, r2$normp, type="h", col="red", ylab="PDF",
xlab="Period in seconds")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.