On 27/05/2015 16:54, Roy Mendelssohn - NOAA Federal wrote:
Hi All:
Is there a routine in R that allows me to simulate a time series that has a
given spectrum? I have looked at the R Time Series Task view, and have done a
web search also, including an article to appear in the handbook of statistics
on time series in R, but I don’t see anything offhand. There are some that
will simulate state-space models or for given covariances matrices, but for a
variety of reasons I would prefer simulating series with a given spectrum.
It is relatively simple to do for series of lengths a power of two (and
you can simulate a longer series to achieve this). Use the spectrum
values to simulate independent complex normals with uniform phase and
variance proportional to the spectral density at the Fourier frequencies
then use the inverse fft() to get the series.
You should be able to copy some code from boot::tsboot()'s 'scramble'
method.
Thanks for any help.
-Roy
**********************
"The contents of this message do not reflect any position of the U.S. Government or
NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new address and phone***
110 Shaffer Road
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: roy.mendelss...@noaa.gov www: http://www.pfeg.noaa.gov/
--
Brian D. Ripley, rip...@stats.ox.ac.uk
Emeritus Professor of Applied Statistics, University of Oxford
1 South Parks Road, Oxford OX1 3TG, UK
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.