Description Usage Arguments Details Examples
Probability density function for a truncated sinusoidal curve. \loadmathjax
1 | sinewavePDF(x, min, max, f, p, r)
|
x |
Numeric vector of years |
min, max |
Lower and upper \mjseqnx limits of the distribution |
f |
Numeric frequency (cycles per unit \mjseqnx). |
p |
Numeric between \mjseqn0 and \mjseqn2\pi, giving the cycle position (in radians) at \mjseqnx = 0. |
r |
Numeric between 0 and 1, determining how flat the distribution is. |
The usual function to describe a sine wave is \mjseqnf(x) = A\sin(2\pi f x + p), where \mjseqnA is the amplitude, \mjseqnf is the frequency (cycles per year), and \mjseqnp is the cycle position (in radians) at \mjseqnx = 0, and therefore oscillates above and below the x-axis.
However, a sinusoidal PDF must by definition always be non-negative, which can conceptually be considered as a sine wave stacked on top of a uniform distribution with a height \mjseqnA + k, where \mjseqnk >= 0. Since the PDF is \mjseqnf(x) divided by the area below the curve, A and k simplify to a single parameter \mjseqnr that determines the relative proportions of the uniform and sinusoidal components, such that:
when \mjseqnr = 0 the amplitude of the sine wave component is zero, and the overall PDF is just a uniform distribution between min and max.
when \mjseqnr = 1 the uniform component is zero, and the minima of the sine wave touches zero. This does not necessarily mean the PDF minimum equals zero, since a minimum point of the sine wave may not occur with PDF domain (truncated between min and max).
Therefore the formula for the PDF is:
\mjsdeqn\frac1 + \sin(2\pi f x + p) - \ln(r)(x_max - x_min)(1 - \ln(r)) + (\frac12\pi f)[\cos(2\pi f x_min - p) - \cos(2\pi f x_max - p)] where \mjseqnx = years, and \mjseqnx_min and \mjseqnx_max determine the truncated date range.
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.