1
1
\name {landmarkreg }
2
2
\alias {landmarkreg }
3
3
\title {
4
- Landmark Registration of Functional Observations
4
+ Landmark Registration of Functional Observations with Differing
5
+ Ranges
5
6
}
6
7
\description {
7
8
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
23
24
\code {smooth.morph } ensures monotonicity.
24
25
}
25
26
\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 )
28
29
}
29
30
\arguments {
30
31
\item {unregfd }{
@@ -45,10 +46,18 @@ landmarkreg(unregfd, ximarks, x0marks=xmeanmarks,
45
46
used.
46
47
Object x0marks may also be a vector.
47
48
}
49
+ \item {x0lim }{
50
+ A vector of length 2 containing the lower and upper boundary of
51
+ the interval containing \code {x0marks }.
52
+ }
48
53
\item {WfdPar }{
49
54
a functional parameter object defining the warping functions that
50
55
transform time in order to register the curves.
51
56
}
57
+ \item {WfdPar0 }{
58
+ a functional parameter object defining the inverse warping functions
59
+ that transform time in order to register the curves.
60
+ }
52
61
\item {ylambda }{
53
62
Smoothing parameter controlling the smoothness of the registered
54
63
functions. It can happen with high dimensional bases that local
@@ -100,56 +109,7 @@ landmarkreg(unregfd, ximarks, x0marks=xmeanmarks,
100
109
}
101
110
\seealso {
102
111
\code {\link {register.fd }},
103
- \code {\link {landmarkreg2 }},
112
+ \code {\link {landmarkreg }},
104
113
\code {\link {smooth.morph }}
105
114
}
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
- }
155
115
\keyword {smooth }
0 commit comments