inlabru: "You might want to consider to setting ``control.predictor=list(link=...)''"

360 views
Skip to first unread message

Seth Flaxman

unread,
Oct 3, 2023, 7:18:12 AM10/3/23
to r-inla-disc...@googlegroups.com
Hi all. Can someone please tell me the syntax that is expected for control.predictor?

My code:

fit <- bru(y ~ age,  family = "binomial", data = df)

Which gives the following warning:

*** Warning *** You might want to consider to setting ``control.predictor=list(link=...)''
*** Warning *** otherwise the identity link will be used to compute the fitted values for NA data

In vanilla INLA, I'd pass

    control.family = list(control.link = list(model = "logit"))

to inla(...)

but I'm not sure what the equivalent is here.

Thanks!
Seth

Thierry Onkelinx

unread,
Oct 3, 2023, 7:57:32 AM10/3/23
to Seth Flaxman, r-inla-disc...@googlegroups.com
Dear Seth,

Simply add control.predictor=list(link= 1). The number refers to the number of the response. So always 1, unless you are using multiple response variables in the same model.

fit <- bru(y ~ age,  family = "binomial", data = df, control.predictor=list(link= 1))

Best regards,

ir. Thierry Onkelinx
Statisticus / Statistician

Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
thierry....@inbo.be
Havenlaan 88 bus 73, 1000 Brussel
www.inbo.be

///////////////////////////////////////////////////////////////////////////////////////////
To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey
///////////////////////////////////////////////////////////////////////////////////////////




Op di 3 okt 2023 om 13:18 schreef Seth Flaxman <fla...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "R-inla discussion group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to r-inla-discussion...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/r-inla-discussion-group/CAPGk9pckuAMxmX%3DL6j6HuXF_X2PzcFbg4Gp3%3DSVXpsBH%3DfmPkg%40mail.gmail.com.

Finn Lindgren

unread,
Oct 3, 2023, 8:12:38 AM10/3/23
to Seth Flaxman, r-inla-disc...@googlegroups.com
Hmmm, inlabru is supposed to set the link information automatically, so there might be something else going on here.

But for control.family in bru(), you specify it as an ordinary argument or as an argument to the like() function. (Other control. arguments need to be given in the options list argument.)

Finn

On 3 Oct 2023, at 12:18, Seth Flaxman <fla...@gmail.com> wrote:


--

Finn Lindgren

unread,
Oct 3, 2023, 8:15:27 AM10/3/23
to Thierry Onkelinx, Seth Flaxman, r-inla-disc...@googlegroups.com
Control.predictor has to be given as options=list(control.predictor=…) in bru() calls.
But the needed link info should be automatically supplied by bru(), so there may be a bug. Seth, are you able to send a reprex (e.g. via GitHub issue)?
Finn

On 3 Oct 2023, at 12:57, 'Thierry Onkelinx' via R-inla discussion group <r-inla-disc...@googlegroups.com> wrote:


Reply all
Reply to author
Forward
0 new messages