Learn R Programming

⚠️There's a newer version (2.2) of this package.Take me there.

astsa — applied statistical time series analysis

... more than just data


... astsa is the R package to accompany 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 that scripts starting with x will be phased out eventually. Old code will run by adding an x; e.g., xKfilter1(...) instead of Kfilter1().

We won't 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.

The Springer text was written under version 1.8 and the Chapman & Hall text was written under version 1.9. Later versions will work for both texts with only some minor changes that won't affect any of the data analysis.

Copy Link

Version

Install

install.packages('astsa')

Monthly Downloads

9,203

Version

2.0

License

GPL-3

Maintainer

David Stoffer

Last Published

January 9th, 2023

Functions in astsa (2.0)

BCJ

Daily Returns of Three Banks
EQcount

EQ Counts
ESS

Effective Sample Size (ESS)
EXP6

Seismic Trace of Explosion number 6
ARMAtoAR

Convert ARMA Process to Infinite AR Process
FDR

Basic False Discovery Rate
EBV

Entire Epstein-Barr Virus (EBV) Nucleotide Sequence
ENSO

El Nino - Southern Oscillation
EQ5

Seismic Trace of Earthquake number 5
EM

EM Algorithm for State Space Models
Grid

A Better Add Grid to a Plot
Ksmooth

Quick Kalman Smoother
Hare

Snowshoe Hare
LagReg

Lagged Regression
HCT

Hematocrit Levels
Lynx

Canadian Lynx
SV.mcmc

Fit Bayesian Stochastic Volatility Model
PLT

Platelet Levels
Months

Month Labels
Kfilter

Quick Kalman Filter
SVfilter

Switching Filter (for Stochastic Volatility Models)
ar1miss

AR with Missing Values
UnempRate

U.S. Unemployment Rate
SigExtract

Signal Extraction And Optimal Filtering
WBC

White Blood Cell Levels
arf

Simulated ARFIMA
acf1

Plot and print ACF or PACF of a time series
acf2

Plot and print ACF and PACF of a time series
blood

Daily Blood Work with Missing Values
acfm

ACF and CCF for Multiple Time Series
ar.mcmc

Fit Bayesian AR Model
chicken

Monthly price of a pound of chicken
ccf2

Cross Correlation
autoSpec

autoSpec - Changepoint Detection of Narrowband Frequency Changes
bart

Bartlett Kernel
beamd

Infrasonic Signal from a Nuclear Explosion
bnrf1ebv

Nucleotide sequence - BNRF1 Epstein-Barr
arma.spec

Spectral Density of an ARMA Model
djia

Dow Jones Industrial Average
cpg

Hard Drive Cost per GB
astsa-package

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

Cardiovascular Mortality from the LA Pollution study
detrend

Detrend a Time Series
birth

U.S. Monthly Live Births
climhyd

Lake Shasta inflow data
autoParm

autoParm - Structural Break Estimation Using AR Models
astsa.col

astsa color palette with transparency
ffbs

Forward Filtering Backward Sampling
fmri

fMRI - complete data set
flu

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

fMRI Data Used in Chapter 1
econ5

Five Quarterly Economic Series
lead

Leading Indicator
eqexp

Earthquake and Explosion Seismic Series
gtemp_ocean

Global mean ocean temperature deviations - updated to 2021
lag1.plot

Lag Plot - one time series
hor

Hawaiian occupancy rates
jj

Johnson and Johnson Quarterly Earnings Per Share
dna2vector

Convert DNA Sequence to Indicator Vectors
gtemp2

Global Mean Surface Air Temperature Deviations
gtemp_land

Global mean land temperature deviations - updated to 2021
prodn

Monthly Federal Reserve Board Production Index
gas

Gas Prices
matrixpwr

Powers of a Square Matrix
bnrf1hvs

Nucleotide sequence - BNRF1 of Herpesvirus saimiri
mvspec

Univariate and Multivariate Spectral Estimation
cardox

Monthly Carbon Dioxide Levels at Mauna Loa
gdp

Quarterly U.S. GDP
globtemp

Global mean land-ocean temperature deviations to 2015
lag2.plot

Lag Plot - two time series
lap

LA Pollution-Mortality Study
oil

Crude oil, WTI spot price FOB
sarima

Fit ARIMA Models
sarima.for

ARIMA Forecasting
sales

Sales
part

Particulate levels from the LA pollution study
qinfl

Quarterly Inflation
qintr

Quarterly Interest Rate
nyse

Returns of the New York Stock Exchange
soiltemp

Spatial Grid of Surface Soil Temperatures
salmon

Monthly export price of salmon
globtempl

Global mean land (only) temperature deviations to 2015
sleep1

Sleep State and Movement Data - Group 1
gnp

Quarterly U.S. GNP
gtemp

Global mean land-ocean temperature deviations
specenv

Spectral Envelope
speech

Speech Recording
rec

Recruitment (number of new fish index)
polio

Poliomyelitis cases in US
polyMul

Multiplication of Two Polynomials
sp500.gr

Returns of the S&P 500
salt

Salt Profiles
so2

SO2 levels from the LA pollution study
soi

Southern Oscillation Index
trend

Estimate Trend
sarima.sim

ARIMA Simulation
sleep2

Sleep State and Movement Data - Group 2
xKsmooth2

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

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

State Space Model
star

Variable Star
scatter.hist

Scatterplot with Marginal Histograms
xA_readme

Scripts marked with an 'x' are scheduled to be phased out
tsplot

Time Series Plot
unemp

U.S. Unemployment
saltemp

Temperature Profiles
sp500w

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

Annual Varve Series
xEM0

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

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

Temperatures from the LA pollution study
xKfilter2

Kalman Filter - This script has been superseded by Kfilter.
test.linear

Test Linearity of a Time Series via Normalized Bispectrum
spec.ic

Estimate Spectral Density of a Time Series from AR Fit
xKfilter1

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

Biannual Sunspot Numbers
stoch.reg

Frequency Domain Stochastic Regression
xKfilter0

Kalman Filter - This script has been superseded by Kfilter
xEM1

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