Skip to content

Commit 436d07e

Browse files
committed
update to 5.5.0
1 parent 60abf53 commit 436d07e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

R/smooth.surp.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ smooth.surp <- function(argvals, Wbin, Bmat0, WfdPar, wtvec=NULL, conv=1e-4,
8787
Wbasis <- WfdPar$fd$basis
8888
Wnbasis <- Wbasis$nbasis
8989
Wlambda <- WfdPar$lambda
90-
Wpenalty <- eval.penalty(WfdPar)
90+
Wpenalty <- eval.penalty(Wbasis, WfdPar$Lfd)
9191

9292
# Check BMAT0, the WNBASIS by M-1 coefficient matrix
9393

@@ -135,7 +135,7 @@ smooth.surp <- function(argvals, Wbin, Bmat0, WfdPar, wtvec=NULL, conv=1e-4,
135135

136136
# Set up list object for data required by PENSSEfun
137137

138-
dataList <- list(argvals=argvals, Wbin=Wbin, wtvec=wtvec, Kmat=Kmat,
138+
surpList <- list(argvals=argvals, Wbin=Wbin, wtvec=wtvec, Kmat=Kmat,
139139
Zmat=Zmat, Phimat=Phimat, M=M)
140140
# --------------------------------------------------------------------
141141
# loop through variables and curves
@@ -145,7 +145,7 @@ smooth.surp <- function(argvals, Wbin, Bmat0, WfdPar, wtvec=NULL, conv=1e-4,
145145
# and its derivatives with respect to these coefficients
146146

147147
xold <- matrix(Bmat0, Wnbasis*(M-1),1)
148-
result <- surp.fit(xold, dataList)
148+
result <- surp.fit(xold, surpList)
149149
PENSSE <- result[[1]]
150150
DPENSSE <- result[[2]]
151151
D2PENSSE <- result[[3]]
@@ -196,12 +196,12 @@ smooth.surp <- function(argvals, Wbin, Bmat0, WfdPar, wtvec=NULL, conv=1e-4,
196196
iternum <- iternum + 1
197197
# take optimal stepsize
198198
lnsrch_result <-
199-
lnsrch(xold, fold, gvec, pvec, surp.fit, dataList, STEPMAX)
199+
lnsrch(xold, fold, gvec, pvec, surp.fit, surpList, STEPMAX)
200200
x <- lnsrch_result$x
201201
check <- lnsrch_result$check
202202
if (check) stop("lnsrch failure")
203203
Bmatnew <- matrix(x,Wnbasis,M-1)
204-
func_result <- surp.fit(Bmatnew, dataList)
204+
func_result <- surp.fit(Bmatnew, surpList)
205205
f <- func_result[[1]]
206206
gvec <- func_result[[2]]
207207
hmat <- func_result[[3]]

0 commit comments

Comments
 (0)