Skip to content
Back to skills

Tseries

ASecurity

R tseries package for time series analysis. Use for time series tests and GARCH models.

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added June 4, 2026
data

Security analysis

A100/100

Scanned June 4, 2026

npx -y skills add LeoLin990405/r-analytics-skill --skill tseries --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Tseries?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Tseries
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/leolin990405-tseries/badge)](https://www.skillsdirectory.com/skills/leolin990405-tseries)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: tseries
description: R tseries package for time series analysis. Use for time series tests and GARCH models.
---

# tseries

Time series analysis and computational finance.

## Stationarity Tests

```r
library(tseries)

# Augmented Dickey-Fuller test
adf.test(ts_data)
# H0: non-stationary (unit root)
# p < 0.05 -> reject H0 -> stationary

# KPSS test
kpss.test(ts_data)
# H0: stationary
# p < 0.05 -> reject H0 -> non-stationary

# Phillips-Perron test
pp.test(ts_data)
```

## GARCH Models

```r
# Fit GARCH(1,1)
fit <- garch(returns, order = c(1, 1))
summary(fit)

# Residuals
residuals(fit)

# Fitted values
fitted(fit)
```

## ARMA

```r
# Fit ARMA
fit <- arma(ts_data, order = c(2, 1))
summary(fit)
```

## Jarque-Bera Test

```r
# Test for normality
jarque.bera.test(returns)
# H0: data is normally distributed
```

## Runs Test

```r
# Test for randomness
runs.test(as.factor(sign(returns)))
```

## BDS Test

```r
# Test for independence
bds.test(returns)
```

## Portfolio Optimization

```r
# Efficient frontier
portfolio.optim(returns_matrix)

# With constraints
portfolio.optim(returns_matrix,
  pm = target_return,
  shorts = FALSE)
```

## Cointegration

```r
# Engle-Granger test
po.test(cbind(x, y))

# Phillips-Ouliaris test
po.test(cbind(x, y), type = "Pu")
```

## Autocorrelation

```r
# Ljung-Box test
Box.test(ts_data, type = "Ljung-Box", lag = 10)

# Box-Pierce test
Box.test(ts_data, type = "Box-Pierce")
```

## Data

```r
# Get financial data
get.hist.quote(instrument = "AAPL",
  start = "2020-01-01",
  end = "2023-12-31",
  quote = "Close")
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…