image.psds: Plot method for psds class

View source: R/internal_psdsPlot_s3.R

image.psdsR Documentation

Plot method for psds class

Description

This function produces a spectogram from a psds object.

Usage

## S3 method for class 'psds'
image(x, func = "median", logZ = TRUE, zoomFreq = c(0, 1), fs = 16384, ...)

Arguments

x

an object of class psds

func

statistics to be applied to x, e.g., median or mean

logZ

logical value (default is TRUE) to determine if the PSD should be on log scale

zoomFreq

interval which specifies the frequency axis to be plotted, for instance, c(0.2, 0.7) leaves out the 20% and 30% of the low and high frequencies, respectively. The default value is c(0,1), i.e., all the frequencies

fs

sampling frequency

...

other graphical parameters from the image.plot function

Value

plot of the estimate of the (log) spectrum

See Also

gibbs_pspline

Examples

## Not run: 

set.seed(1)

# Generate AR(1) data with rho = 0.9
n = 128
data = arima.sim(n, model = list(ar = 0.9));
data = data - mean(data);

# Spectrum estimate via p-splines
spec = spec_pspline(data, l=30, p=20, Ntotal1=3000, burnin1=1000, thin1=10,
                    Ntotal=3000, burnin=1000, thin=10, k=30);

image(spec) # Plot log PSD (see documentation of iplot.psds)

## End(Not run)

pmat747/psplinePsd documentation built on July 7, 2023, 9:06 p.m.