Topic: Utilities

Topic Description:

Basic R utilities used in many packages and functions, such as date and string manipulations, statistical distributions, geometry of lines and distances. The R package date is required for the two data functions.



File: utilities/statistics.r

View File Source Download File No help file available

Function: autoregression

Function Description: autoregression

Autocorrelation with a given lag of a vector y.

Function Arguments:

ArgumentDefault Value
y
lag
xlogFALSE
ylogFALSE
graphitTRUE

Function Source:

autoregression=function(y,lag,xlog=FALSE,ylog=FALSE,graphit=TRUE)
{
N=length(y)

lagindex=(1+lag):N
nonlagindex=1:(N-lag)

ylag=y[lagindex]
ynon=y[nonlagindex]

return(regress.loglog(ynon,ylag,xlog=xlog,ylog=ylog,graphit=graphit))
}