CVT: Functional quantization via Centroidal Voronoi Tessellation

Description Usage Arguments Value See Also Examples

View source: R/CVT.R

Description

Data driven functional quantization based on Centroidal Voronoi Tessellation.

Usage

1
CVT(data,size,iter=22)

Arguments

data

matrix that we want to quantize.

size

size of the quantization grids.

iter

the number of iterations.

Value

data

the input matrix.

quantizer

the quantizer grid.

weights

the associated weight of each curve (calculated using the input matrix).

See Also

StochGradient and GFQ

Examples

 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))
size <- 10
quant <- CVT(data,size,iter=22)

elamrireda/FunctQuant documentation built on Jan. 1, 2021, 2:50 p.m.