View source: R/plotTraceback.R
This function is a debugging tool.
1 | plotTraceback(model, sleep = 2, ...)
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | # Example using artificially generated data
# Example using artificially generated data
set.seed(1)
m <- 10
x1 <- (0:m)/m
x2 <- (0:m)/m
x <- as.matrix(expand.grid(x1,x2))
n <- nrow(x)
F1 <- function(x1,x2, a = 2.5, b = 1.0) {
x <- x1 - 0.5; y <- x2 - 0.5
angle <- a*exp(-(x*x+y*y)/(b*b)) + 3*pi/2
return(cos(angle)*x + sin(angle)*y + 0.5)
}
F2 <- function(x1,x2, a = 2.5, b = 1.0) {
x <- x1 - 0.5; y <- x2 - 0.5
angle <- a*exp(-(x*x+y*y)/(b*b)) + 3*pi/2
return(-sin(angle)*x + cos(angle)*y + 0.5)
}
TIME <- 20
covModel <- RMexp(var = 1, scale = .25) + RMnugget(var = 1) # Independent in time
data <- RFsimulate(covModel, x = F1(x[,1],x[,2]), y = F2(x[,1],x[,2]), T = 1:TIME)
y <- as.numeric(unlist(data@data))
covModelM <- RMexp(var = NA, scale = NA) + RMnugget(var = NA)
test.def <- bdef(x, y, tim = 1:TIME, cov.model = covModelM, maxit = 10)
# Estimated deformation
plotGrid(test.def)
plotTraceback(test.def, margins = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.