KS_
KS_

Reputation: 41

Q: mgcv::gam() with constraints on the coefficents

I'm fitting a logit GAM model and need to impose an inequality constraint on betas in the smooth terms. I've tried mgcv::pcls(), but it seems I can't specify the independent inequalities for the different spline coefficients. What's the recommended way to achieve this?

Upvotes: 2

Views: 411

Answers (1)

KS_
KS_

Reputation: 41

Found an answer myself, posting it just in case someone will look for it. The mono.con function in mgcv generates constraint matrices Ain and bin. For several splines, Ain matrices should be just put together into a single block-diagonal matrix.

Upvotes: 2

Related Questions