Description Usage Arguments Value Examples
View source: R/Karhunen_Loeve.R
Dimension reduction : Karhunen Loeve expansion
1 | Karhunen_Loeve(data,mKL,scale=TRUE)
|
data |
matrix that we want to quantize. |
mKL |
truncation argument for the dimension reduction. |
scale |
scale or not the input data. |
Coeff |
the coefficient in the reduced space. |
ExplainedVar |
the explained variance. |
center |
the mean curve. |
eigenfunction |
the eigenfunctions. |
1 2 3 4 5 6 7 8 9 10 11 12 13 | ##### function to generate realizations of BM
BM <- function(N=1000,M=1,x0=0,t0=0,T=1,Dt=NULL)
{
Dt <- (T - t0)/N
t <- seq(t0, T, by=Dt)
res <- data.frame(sapply(1:M,function(i) c(0,cumsum(rnorm(N,mean =0,sd=sqrt(Dt))))))
names(res) <- paste("X",1:M,sep="")
X <- ts(res, start = t0, deltat = Dt)
return(X)
}
data <- t(BM(N = 200 - 1, M = 200))
mKL <- 2
DimReduction <- Karhunen_Loeve(data,mKL,scale=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.