Skip to content

How to set up an additive linear predictor in liesel #105

Answered by jobrachem
Seb-Lorek asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Seb-Lorek, thanks for your question! 😊

The code you use looks to me like it would work. You are using the lsl.Calc class exactly like it is intended to be used, by providing the function that you need to be executed. It is indeed possible to use the DistRegBuilder for this, but since it is not well-documented at the moment, let's not get into that here.

One thing you could do is more clearly separate the linear part and the nonlinear part with a setup like this:

x_lin = ... # the design matrix for the linear effect

x_lin_node = lsl.Obs(x_lin, name="x_lin")
coef_lin = lsl.Param(..., name="beta_lin")
smooth_lin_calc = lsl.Calc(jnp.dot, x_lin, coef_lin)
smooth_lin = lsl.Var(smooth_lin_calc

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
5 replies
@Seb-Lorek
Comment options

@jobrachem
Comment options

@Seb-Lorek
Comment options

@jobrachem
Comment options

@jobrachem
Comment options

Answer selected by Seb-Lorek
Comment options

You must be logged in to vote
5 replies
@jobrachem
Comment options

@wiep
Comment options

wiep Oct 30, 2023
Maintainer

@jeli2103
Comment options

@jobrachem
Comment options

@jobrachem
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants