Last data update: 2014.03.03

R: Main function to perform multiresolution warping for...
MRwarpR Documentation

Main function to perform multiresolution warping for functional data in a Bayesian way.

Description

The Bayesian procedure starts with one warplet in the model and uses the posterior distributions as priors for a more extended model with one more warplet. The model is built with adding one warplet at a time and allows for amplitude variations.

Usage

MRwarp(Xdata, Ydata, chain = 400, thin = 10, burnin = 200, kernel.s,
 	components = 1, selection = "FIXED", shr = 0.3, outputfit = 1, 
	alpha = 0.1)

Arguments

Xdata

N by T matrix containing the T x-coordinates or time points of the N curve observations. Each row corresponds to a particular subject. No default.

Ydata

N by T matrix containing the T y-coordinates or response values of the N curve observations. Each row corresponds to a particular subject. No default.

chain

The total number of MCMC iterations (default=400).

thin

The thinning factor of the MCMC algorithm (default=10).

burnin

The number of MCMC iterations that are discarded (default=200).

kernel.s

Vector containing the starting values for the kernel parameters. No default.

components

The number of warping components in the final model (default=1). The value is ignored when selection="STEP".

selection

Whether we want to estimate a fixed number of warplets ("FIXED"), or evaluate the warping procedure after each component ("STEP") (default= "FIXED").

shr

Determines the variance of the prior on the warplet intensities and shifts (default = 0.3).

outputfit

1 if the warped curves should be plotted after each estimated model, 0 otherwise (default=1).

alpha

The significance level to be used in the model selection procedure (default=0.1).

Value

last

List of output values for the last fitted model.

previous

List of output values for the one but last fitted model.

shift

Component of the output list. A MCMC chain of the estimated horizontal shift for curves 1 to N.

warping

Component of the output list that is itself a list containing four quantities: lower, A, upper and Intensities.

lower

Component of warping. Adaptive MCMC chains of the estimated warping lower bounds (w_{l,1}, …, w_{l,Q-1}).

A

Component of warping. Adaptive MCMC chains of the estimated warping centers (a_1, …, a_{Q-1}).

upper

Component of warping. AMCMC chains of the estimated warping upper bounds (w_{u,1}, …, w_{u,Q-1}).

Intensities

Component of warping. Adaptive MCMC chains of the estimated warping intensities, first all N values for warplet 1,..., all N values for warplet Q.

kernels

Component of the output list. Adaptive MCMC chains of the estimated kernel lower bounds, centers and upper bounds.

error.variance

Component of the output list. The estimated value of the error variance.

max.post.dens

Component of the output list. The row in the parameter chain vectors/matrices corresponding to the highest posterior pseudo-log-likelihood.

Author(s)

L. Slaets, G. Claeskens, B.W. Silverman.

References

See the papers: Slaets, Claeskens and Silverman (2010). Warping functional data in R and C via a Bayesian Multiresolution approach. Journal of Statistical Software, 55(3), 1-22,
URL http://www.jstatsoft.org/v55/i03/.

Claeskens, Silverman and Slaets (2010). A multiresolution approach to time warping achievec by a Bayesian prior-posterior transfer fitting strategy. Journal of the Royal Statistical Society, Series B, 72(5), 673-694.

Examples

data(TICdata)
TIC = as.matrix(TICdata)

index = 1:200*2-1
TICy = t(matrix(index,200,11))
x = 1:400
for (i in 1:11)
	{
	TIC.sm = spm(TIC[i,]~f(x))
	TICy[i,] = TIC.sm$fit$fitted[index]
	}
TICx = t(matrix(index,200,11))
kernel.s = c(70,100,130,270,285,300)

## Not run: 
output = MRwarp(Xdata=TICx,Ydata=TICy,chain=100,thin=5,burnin=50,kernel.s,
components=1,selection="FIXED",shr=0.3,outputfit=1,alpha=0.1)

## End(Not run)

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(MRwarping)
Loading required package: boa
Loading required package: SemiPar
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/MRwarping/MRwarp.Rd_%03d_medium.png", width=480, height=480)
> ### Name: MRwarp
> ### Title: Main function to perform multiresolution warping for functional
> ###   data in a Bayesian way.
> ### Aliases: MRwarp
> 
> ### ** Examples
> 
> data(TICdata)
> TIC = as.matrix(TICdata)
> 
> index = 1:200*2-1
> TICy = t(matrix(index,200,11))
> x = 1:400
> for (i in 1:11)
+ 	{
+ 	TIC.sm = spm(TIC[i,]~f(x))
+ 	TICy[i,] = TIC.sm$fit$fitted[index]
+ 	}
> TICx = t(matrix(index,200,11))
> kernel.s = c(70,100,130,270,285,300)
> 
> ## Not run: 
> ##D output = MRwarp(Xdata=TICx,Ydata=TICy,chain=100,thin=5,burnin=50,kernel.s,
> ##D components=1,selection="FIXED",shr=0.3,outputfit=1,alpha=0.1)
> ## End(Not run)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>