R: Value of quadratic forms for the inverse of a symmetric...
ltza
R Documentation
Value of quadratic forms for the inverse of a symmetric positive definite
autocorrelation matrix.
Description
The function ltza is used to calculate the value of quadratic forms for the
inverse of a symmetric positive definite autocorrelation matrix, using the
Levinson algorithm (Golub and Van Loan 1996, Algorithm 4.7.2).
Usage
ltza(r,x)
Arguments
r
autocorelation vector
x
time series data
Value
Vector with values t(x) * solve(R) * x, t(en) * solve(R) * x,
t(en) * solve(R) * en and the natural logarithm of the determinant of R. t(.)
denotes the transpose of a vector, en = (1,1,...,1) and R is the autocorrelation
matrix.
Author(s)
Hristos Tyralis
References
Golub G.H., Van Loan C.F. (1996) Matrix Computations, Baltimore: John
Hopkins University Press.
Examples
# Estimate the parameters for the Nile time series.
r <- acfHKp(H = 0.8,maxlag = length(Nile)-1)
examp <- ltza(r,Nile)
# Comparison of the algorithm with typical approaches
examp[1] - as.numeric(t(Nile) %*% solve(toeplitz(r)) %*% Nile)
examp[2] - as.numeric(t(rep(1,length(r))) %*% solve(toeplitz(r)) %*% Nile)
examp[3] - as.numeric(t(rep(1,length(r))) %*% solve(toeplitz(r)) %*%
rep(1,length(r)))
examp[4] - log(det(toeplitz(r)))
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(HKprocess)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/HKprocess/ltza.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ltza
> ### Title: Value of quadratic forms for the inverse of a symmetric positive
> ### definite autocorrelation matrix.
> ### Aliases: ltza
> ### Keywords: array
>
> ### ** Examples
>
> # Estimate the parameters for the Nile time series.
>
> r <- acfHKp(H = 0.8,maxlag = length(Nile)-1)
>
> examp <- ltza(r,Nile)
>
> # Comparison of the algorithm with typical approaches
>
> examp[1] - as.numeric(t(Nile) %*% solve(toeplitz(r)) %*% Nile)
t(x) * solve(R) * x
3.72529e-09
>
> examp[2] - as.numeric(t(rep(1,length(r))) %*% solve(toeplitz(r)) %*% Nile)
t(en) * solve(R) * x
9.094947e-13
>
> examp[3] - as.numeric(t(rep(1,length(r))) %*% solve(toeplitz(r)) %*%
+ rep(1,length(r)))
t(en) * solve(R) * en
-8.881784e-16
>
> examp[4] - log(det(toeplitz(r)))
natural logarithm of determinant
1.421085e-14
>
>
>
>
>
> dev.off()
null device
1
>