---
name: "gbacorr"
section: "1"
platform: "linux"
package: "gbutils"
version: "6.3-1+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/gbacorr"
---

# gbacorr(1)

Compute auto/cross-correlation coefficients

## NAME

gbacorr - Compute auto/cross-correlation coefficients

## SYNOPSIS

**gbacorr** \[*options*\]

## DESCRIPTION

Compute auto/cross-correlation coefficients

If the input is a single columns x\_1...X\_T, the autocorrelation function c(t) is printed, defined as

-

  c\_{t} = 1/(T-t-1) \\sum\_i (x\_i-m) (x\_{i+t}-m) /s^2

where m is the sample average and s the standard deviation. With a second column y\_1...y\_T, the cross-correlation

-

  c\_{t} = 1/(T-t-1) \\sum\_i (x\_i-mx) (y\_{i+t}-my) /(sx sy)

is printed where mx and my are the average values of the two columns and sx and sy their standard deviations. With **-M** 1 it is mx=my=0, the st.dev. is computed accordingly and in the previous formula T-t-1 is replaced by T-t. The range of t is set by option **-t**. Options

- **-M**

  choose the method (default '0'):

- 0

  auto/cross-correlation with mean removal,

- 1

  auto/cross-correlation without mean removal

- **-t**

  set range of t (default '0,10'), accept negative integers

- **-p**

  specify the confidence level in (0,1). Interval ac\_low,ac\_hi has a probability 1-confidence to contain the true value. With this option the output becomes: lag ac ac\_low ac\_hi.

- **-F**

  specify the input fields separators (default " \\t")

- **-h**

  this help

## EXAMPLES

- gbacorr -t 0,2 '[file(1)](/file/1.md)'

  first three a.c. coeff. of the first data column

- gbacorr -p 0.05 'file(1:2)' x-corr of the first two columns together with

  their 5% confidence intervals

## AUTHOR

Written by Giulio Bottazzi

## REPORTING BUGS

Report bugs to \<gbutils@googlegroups.com\>

Package home page \<http://cafim.sssup.it/~giulio/software/gbutils/index.html\>

## COPYRIGHT

Copyright © 2001-2018 Giulio Bottazzi This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (version 2) as published by the Free Software Foundation;

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
