sincos: Fourier SSA

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/ssa.R

Description

Fourier SSA

Usage

1
sincos(L)

Arguments

L

window length

Details

~~ If necessary, more details than the description above ~~

Value

s

matrix of Fourier coefficients

Note

~~further notes~~

Author(s)

~~who you are~~

References

~put references to the literature/web site here ~

See Also

~~objects to See Also as help, ~~~

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function(L) {
    x<-2*pi*(1:L)/L
    M<-floor(L/2)
    if (is.even(L)) N<-M-1 else N<-M
    s<-matrix(0,L,N+M+1)
    for (k in 1:N)
        s[,k]<-sin(x*k)
    for (k in 0:M)	        
        s[,N+k+1]<-cos(x*k)
return(apply(s,2,function(z) z/sqrt(sum(z^2))))
  }

ssa documentation built on May 2, 2019, 5:54 p.m.

Related to sincos in ssa...