INNER CODE UNIT · Python
rtwtvec
XMU-Kuangnan-Fang-Team/GENetLib · GENetLib/BsplineFunc.py:253
rtwtvec = np.sqrt(wtvec)
basisw = (wtvec @ np.ones((1, nbasis + q))) * np.array(basismat)
Bmat = basisw.T @ basismat
Bmat0 = Bmat
if len(dimy) < 3:
Dmat = basisw.T @ y
else:
Dmat = np.zeros((nbasis + q, nrep, nvar))
for ivar in range(nvar):
Dmat[:, :, ivar] = basisw.T @ y[:, :, ivar]
if lambda_ > 0:
if penmat is None:
penmat = BsplineFunc(
basisobj=basisobj, Lfdobj=Lfdobj
).penalty_matrix()
Bnorm = np.sqrt(np.sum(np.diag(Bmat0.T @ Bmat0)))
pennorm = np.sqrt(np.sum(penmat * penmat))
condno = pennorm / Bnorm