Learn R Programming

astsa — applied statistical time series analysis

... more than just data ... it's a palindrome


... astsa includes data sets and scripts for analyzing time series in both the frequency and time domains including state space modeling as well as supporting the Springer text, Time Series Analysis and Its Applications: With R Examples and the Chapman & Hall text Time Series: A Data Analysis Approach using R.

  • Note: scripts and data sets starting with x will be phased out eventually. Old code will run by adding an x; e.g., xKfilter1(...) instead of Kfilter1().

We do not always push the latest version of the package to CRAN, but the latest working version of the package will always be at Github.

  • The ROAD MAP is a good place to start to find all the links to the webpages for the texts and some help on using R for time series analysis.

  • See the NEWS for further details about the state of the package, how to install the latest version, and the changelog.

  • A list of data sets, scripts, and demonstrations of the capabilities of astsa can be found at

FUN WITH ASTSA... it's more fun than high school.

Copy Link

Version

Install

install.packages('astsa')

Monthly Downloads

10,331

Version

2.1

License

GPL-3

Maintainer

Last Published

January 10th, 2024

Functions in astsa (2.1)

EQ5

Seismic Trace of Earthquake number 5
Lynx

Canadian Lynx
MEI

Multivariate El Nino/Southern Oscillation Index (version 1)
acf1

Plot and print ACF or PACF of a time series
acfm

ACF and CCF for Multiple Time Series
arf

Simulated ARFIMA
ar.boot

Bootstrap Distribution of AR Model Parameters
acf2

Plot and print ACF and PACF of a time series
arma.spec

Spectral Density of an ARMA Model
Months

Month Labels
PLT

Platelet Levels
cardox

Monthly Carbon Dioxide Levels at Mauna Loa
ccf2

Cross Correlation
SV.mcmc

Fit Bayesian Stochastic Volatility Model
bart

Bartlett Kernel
GDP23

Quarterly U.S. GDP - updated to 2023
eqexp

Earthquake and Explosion Seismic Series
autoParm

autoParm - Structural Break Estimation Using AR Models
SV.mle

Stochastic Volatility Model with Feedback via MLE
ar1miss

AR with Missing Values
SigExtract

Signal Extraction And Optimal Filtering
GNP23

Quarterly U.S. GNP - updated to 2023
USpop

U.S. Population - 1900 to 2010
beamd

Infrasonic Signal from a Nuclear Explosion
autoSpec

autoSpec - Changepoint Detection of Narrowband Frequency Changes
detrend

Detrend a Time Series
birth

U.S. Monthly Live Births
ffbs

Forward Filtering Backward Sampling
ar.mcmc

Fit Bayesian AR Model
chicken

Monthly price of a pound of chicken
djia

Dow Jones Industrial Average
blood

Daily Blood Work with Missing Values
gdp

Quarterly U.S. GDP
climhyd

Lake Shasta inflow data
gnp

Quarterly U.S. GNP
lag2.plot

Lag Plot - two time series
oil

Crude oil, WTI spot price FOB
fmri1

fMRI Data Used in Chapter 1
sarima

Fit ARIMA Models
astsa.col

astsa color palette with transparency
hor

Hawaiian occupancy rates
lap

LA Pollution-Mortality Study
bnrf1ebv

Nucleotide sequence - BNRF1 Epstein-Barr
UnempRate

U.S. Unemployment Rate
gtemp_ocean

Global mean ocean temperature deviations, 1850-2023
fmri

fMRI - complete data set
astsa-package

Applied Statistical Time Series Analysis (more than just data)
WBC

White Blood Cell Levels
tempr

Temperatures from the LA pollution study
flu

Monthly pneumonia and influenza deaths in the U.S., 1968 to 1978.
bnrf1hvs

Nucleotide sequence - BNRF1 of Herpesvirus saimiri
cmort

Cardiovascular Mortality from the LA Pollution study
sarima.for

ARIMA Forecasting
part

Particulate levels from the LA pollution study
gas

Gas Prices
cpg

Hard Drive Cost per GB
salt

Salt Profiles
ssm

State Space Model
so2

SO2 levels from the LA pollution study
soi

Southern Oscillation Index
saltemp

Temperature Profiles
polio

Poliomyelitis cases in US
sales

Sales
xEM1

EM Algorithm for General State Space Models - This script has been superseded by EM.
test.linear

Test Linearity of a Time Series via Normalized Bispectrum
polyMul

Multiplication of Two Polynomials
xKfilter0

Kalman Filter - This script has been superseded by Kfilter
qinfl

Quarterly Inflation
dna2vector

Convert DNA Sequence to Indicator Vectors
matrixpwr

Powers of a Square Matrix
lead

Leading Indicator
gtemp_both

Global mean land and open ocean temperature deviations, 1850-2023
gtemp_land

Global mean land temperature deviations, 1850-2023
xKsmooth2

Kalman Filter and Smoother - This script has been superseded by Ksmooth
xSVfilter

Switching Filter (for Stochastic Volatility Models) - This script is now part of SV.mle
spec.ic

Estimate Spectral Density of a Time Series from AR Fit
sunspotz

Biannual Sunspot Numbers
prodn

Monthly Federal Reserve Board Production Index
salmon

Monthly export price of salmon
star

Variable Star
stoch.reg

Frequency Domain Stochastic Regression
sp500w

Weekly Growth Rate of the Standard and Poor's 500
econ5

Five Quarterly Economic Series
sarima.sim

ARIMA Simulation
nyse

Returns of the New York Stock Exchange
jj

Johnson and Johnson Quarterly Earnings Per Share
soiltemp

Spatial Grid of Surface Soil Temperatures
qintr

Quarterly Interest Rate
lag1.plot

Lag Plot - one time series
mvspec

Univariate and Multivariate Spectral Estimation
rec

Recruitment (number of new fish index)
scatter.hist

Scatterplot with Marginal Histograms
sleep1

Sleep State and Movement Data - Group 1
speech

Speech Recording
xKsmooth1

Kalman Filter and Smoother - This script has been superseded by Ksmooth
unemp

U.S. Unemployment
xA_readme

SCRIPTS MARKED WITH AN 'x' ARE SCHEDULED TO BE PHASED OUT
xglobtempl

Superseded by gtemp_land - Global mean land temperature deviations.
specenv

Spectral Envelope
xglobtemp

Superseded by gtemp_both - Global mean land-ocean temperature deviations.
sleep2

Sleep State and Movement Data - Group 2
xgtemp2

Superseded by gtemp_land - Global Mean Surface Air Temperature Deviations
xgtemp

Superseded by gtemp_both - Global mean land-ocean temperature deviations.
varve

Annual Varve Series
xKsmooth0

Kalman Filter and Smoother - This script has been superseded by Ksmooth
xEM0

EM Algorithm for Time Invariant State Space Models - This script has been superseded by EM.
sp500.gr

Returns of the S&P 500
xKfilter1

Kalman Filter - This script has been superseded by Kfilter.
trend

Estimate Trend
xKfilter2

Kalman Filter - This script has been superseded by Kfilter.
tsplot

Time Series Plot
EXP6

Seismic Trace of Explosion number 6
EQcount

EQ Counts
FDR

Basic False Discovery Rate
Grid

A Better Add Grid to a Plot
ESS

Effective Sample Size (ESS)
Hare

Snowshoe Hare
LagReg

Lagged Regression
EBV

Entire Epstein-Barr Virus (EBV) Nucleotide Sequence
Kfilter

Quick Kalman Filter
EM

EM Algorithm for State Space Models
ENSO

El Nino - Southern Oscillation Index
BCJ

Daily Returns of Three Banks
Ksmooth

Quick Kalman Smoother
ARMAtoAR

Convert ARMA Process to Infinite AR Process
HCT

Hematocrit Levels