简体   繁体   中英

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

I'm fitting a logit GAM model and need to impose an inequality constraints on beta's 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?

Found an answer myself, posting it just in case someone will look for it. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM