INNER CODE UNIT · Python

Dmat

XMU-Kuangnan-Fang-Team/GENetLib · GENetLib/BsplineFunc.py:260

                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
                if lambda_ * condno > 1e12:
                    lambda_ = 1e12 / condno
                    print(
                        f"Warning: lambda reduced to {lambda_} to prevent overflow"
                    )
                if covariates is not None:
                    penmat = np.block(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…