Skip to content

Commit de67b71

Browse files
committed
update landmarkreg.Rd
1 parent 4ebf487 commit de67b71

File tree

1 file changed

+13
-53
lines changed

1 file changed

+13
-53
lines changed

man/landmarkreg.Rd

+13-53
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
\name{landmarkreg}
22
\alias{landmarkreg}
33
\title{
4-
Landmark Registration of Functional Observations
4+
Landmark Registration of Functional Observations with Differing
5+
Ranges
56
}
67
\description{
78
It is common to see that among a set of functions certain prominent
@@ -23,8 +24,8 @@ warping function must be strictly monotonic, and we have found that using
2324
\code{smooth.morph} ensures monotonicity.
2425
}
2526
\usage{
26-
landmarkreg(unregfd, ximarks, x0marks=xmeanmarks,
27-
WfdPar=NULL, ylambda=1e-10)
27+
landmarkreg(unregfd, ximarks, x0marks, x0lim,
28+
WfdPar=NULL, WfdPar0=NULL, ylambda=1e-10)
2829
}
2930
\arguments{
3031
\item{unregfd}{
@@ -45,10 +46,18 @@ landmarkreg(unregfd, ximarks, x0marks=xmeanmarks,
4546
used.
4647
Object x0marks may also be a vector.
4748
}
49+
\item{x0lim}{
50+
A vector of length 2 containing the lower and upper boundary of
51+
the interval containing \code{x0marks}.
52+
}
4853
\item{WfdPar}{
4954
a functional parameter object defining the warping functions that
5055
transform time in order to register the curves.
5156
}
57+
\item{WfdPar0}{
58+
a functional parameter object defining the inverse warping functions
59+
that transform time in order to register the curves.
60+
}
5261
\item{ylambda}{
5362
Smoothing parameter controlling the smoothness of the registered
5463
functions. It can happen with high dimensional bases that local
@@ -100,56 +109,7 @@ landmarkreg(unregfd, ximarks, x0marks=xmeanmarks,
100109
}
101110
\seealso{
102111
\code{\link{register.fd}},
103-
\code{\link{landmarkreg2}},
112+
\code{\link{landmarkreg}},
104113
\code{\link{smooth.morph}}
105114
}
106-
\examples{
107-
#See the analysis for the lip data in the examples.
108-
109-
## setting parameters
110-
library(lattice)
111-
data(landmark.reg.expData) ## containing an simple object called sampleData
112-
113-
# Preferred:
114-
# eps <- .Machine$double.eps
115-
# to reduce compute time:
116-
eps <- 1000*.Machine$double.eps
117-
from <- -1.0187
118-
to <- 9.4551
119-
# Preferred:
120-
# nb <- 201
121-
# to reduce compute time:
122-
nb <- 31
123-
nbreaks <- 11
124-
## assign landmarks
125-
landmark <- matrix(c(0.4999, 0.657, 0.8141, 0.5523, 0.5523,
126-
3.3279, 3.066, 3.0137, 3.2231, 3.2231),
127-
ncol=2)
128-
wbasis <- create.bspline.basis(rangeval=c(from, to),
129-
norder=4, breaks=seq(from, to, len=nbreaks))
130-
Wfd0 <- fd(matrix(0,wbasis$nbasis,1),wbasis)
131-
WfdPar <- fdPar(Wfd0, 1, 1e-4)
132-
## get the density of the data
133-
x <- split(sampleData, factor(sampleData$which))
134-
# to save time, reduce the number of curves from 5 to 3
135-
k <- 3
136-
densY <- sapply(x[1:k], function(z){
137-
r <- range(z[, 1])
138-
z <- z[, 1]
139-
z <- z[z>r[1]+eps & z<r[2]-eps]
140-
density(z, from=from, to=to, n=nb, na.rm=TRUE)$y
141-
})
142-
143-
argvals <- seq(from, to, len=nb)
144-
fdobj <- smooth.basis(argvals, densY, wbasis,
145-
fdnames = c("x", "samples", "density"))$fd
146-
# the target landmark values, x0marks, here default to
147-
# the row-wise mean of matrix landmark
148-
regDens <- landmarkreg(fdobj, landmark[1:k,], WfdPar=WfdPar)
149-
150-
warpfdobj <- regDens$warpfd
151-
warpedX <- as.matrix(eval.fd(warpfdobj, argvals))
152-
matplot(argvals, warpedX, type="l")
153-
funs <- apply(warpedX, 2, approxfun, argvals)
154-
}
155115
\keyword{smooth}

0 commit comments

Comments
 (0)