Learn R Programming

peacots (version 1.0)

ps_ouss: Power spectrum of the OUSS process

Description

Returns the power spectrum of the Ornstein-Uhlenbeck state space (OUSS) process at a particular frequency. This is the same as the asymptotic expected periodogram power for long regular time series.

Usage

ps_ouss(freq, power_o, lambda, power_e, time_step)

Arguments

freq
Single number or numeric vector. The frequency for which to the power spectrum is to be calculated.
power_o
Single number. Power at zero-frequency generated by the underlying OU process.
lambda
Single number. Resilience (or relaxation rate) of the OU process. This is also the inverse correlation time of the OU process.
power_e
Single number. Asymptotic power at large frequencies due to the random measurement errors. Setting this to zero corresponds to the classical OU process.
time_step
Positive number. The time step of the time series that was (or will be) used for periodogram generation.

Value

  • Returns a numeric vector of the same size as freq, containing the corresponding powers of the OUSS process.

Details

The OUSS parameters power_o, lambda and power_e will typically be maximum-likelihood fitted values returned by evaluate.pm. time_step is also returned by evaluate.pm and is inferred from the analysed time series. More generally, power_o and power_e are proportional to the OUSS parameters $\sigma^2$ and $\epsilon^2$ (see generate_ouss), respectively, but the exact scaling depends on the normalization used for the periodogram.

References

Louca, S., Doebeli, M. - Detecting cyclicity in ecological time series (in review, as of June 2014)

See Also

evaluate.pm, generate_ouss

Examples

Run this code
# generate OUSS time series
times  = seq(0,20,0.2);
signal = generate_ouss(times, mu=0, sigma=1, lambda=1, epsilon=0.5);

# calculate periodogram and fit OUSS model
report = evaluate.pm(times=times, signal=signal);

# plot periodogram
plot(report$frequencies, report$periodogram, 
     type="l", ylab="power", xlab="frequency", main="periodogram & fitted OUSS power spectrum");

# plot fitted OUSS spectrum
lines(report$frequencies, 
      ps_ouss(freq=report$frequencies, 
              power_o=report$power_o, 
              lambda=report$lambda, 
              power_e=report$power_e, 
              time_step=report$time_step), 
      col="red");

Run the code above in your browser using DataLab