Skip to content

Commit 9da12fe

Browse files
committed
fdParcheck bug
1 parent 7a447e3 commit 9da12fe

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

R/landmarkreg.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ landmarkreg <- function(fdobj, ximarks, x0marks=xmeanmarks,
2525
# WFD ... a functional data object for the W functions defining the
2626
# warping functions
2727

28-
# Last modified 6 January 2020 by Jim Ramsay
28+
# Last modified 16 November 2021 by Jim Ramsay
2929

3030
# check FDOBJ
3131

@@ -48,6 +48,7 @@ landmarkreg <- function(fdobj, ximarks, x0marks=xmeanmarks,
4848
type <- basisobj$type
4949
nbasis <- basisobj$nbasis
5050
rangeval <- basisobj$rangeval
51+
fdobj <- fd(matrix(0,nbasis,ncurve),basisobj)
5152
fdParobj <- fdPar(basisobj, 2, ylambda)
5253

5354
# check landmarks
@@ -71,12 +72,13 @@ landmarkreg <- function(fdobj, ximarks, x0marks=xmeanmarks,
7172
rangex <- basisobj$rangeval
7273
wnbasis <- length(x0marks) + 2
7374
wbasis <- create.bspline.basis(rangex, wnbasis)
74-
WfdParobj <- fdPar(wbasis)
75+
wfd <- fd(matrix(0,wnbasis,ncurve))
76+
WfdParobj <- fdPar(wfd)
7577
}
7678

7779
# check WFDPAR
7880

79-
WfdPar <- fdParcheck(WfdPar)
81+
WfdPar <- fdParcheck(WfdPar, ncurve)
8082

8183
# set up WFD0 and WBASIS
8284

0 commit comments

Comments
 (0)