Adding an asymptote to a linear model of the kappa parameter of a von Mises distribution

60 views
Skip to first unread message

John Kirwan

unread,
Apr 9, 2018, 8:48:47 AM4/9/18
to brms-users

Dear google-group users,


I am trying to estimate both circular mean (mu) and the precision (kappa) of a circular outcome according to a von Mises distribution with respect to an effect on a linear scale.Both a slope and intercept are estimated for each of mu and kappa, as follows:

 

m1.formula <- bf(radians_error ~ polarization_logged,

kappa ~ polarization_logged) + von_mises()

 

 I am mostly interested in the kappa and I wish to introduce an asymptote parameter into the linear equation for kappa, as follows:


                             kappa ~ polarization_logged + lower_asymptote,

                             lower_asymptote ~ 1)

 

Is this possible for an auxiliary parameter in the brms framework?


Kind regards,

John Kirwan

Paul Buerkner

unread,
Apr 10, 2018, 11:14:43 PM4/10/18
to John Kirwan, brms-users
can you explain the purpose of such a parameter for your model?

--
You received this message because you are subscribed to the Google Groups "brms-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brms-users+...@googlegroups.com.
To post to this group, send email to brms-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brms-users/1be2166b-8008-41cc-8c29-029170a526e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

John Kirwan

unread,
Apr 11, 2018, 1:17:14 AM4/11/18
to Paul Buerkner, brms-...@googlegroups.com
 think that the circular concentration should only scale with the predictor for a range of predictor values (above and below which it should be constant). I would like to add a lower limit to better model the lower values of the predictor. 

Paul Buerkner

unread,
Apr 11, 2018, 1:19:45 AM4/11/18
to John Kirwan, brms-users
So you want to use a non-linear model for kappa? That's possible. For this to work, you have to wrap the formula for kappa as well as the related formulas in a call to nlf().

2018-04-11 7:17 GMT+02:00 John Kirwan <jo...@jkirwan.org>:
 think that the circular concentration should only scale with the predictor for a range of predictor values (above and below which it should be constant). I would like to add a lower limit to better model the lower values of the predictor. 
On Wed, Apr 11, 2018, 5:14 AM Paul Buerkner <paul.b...@gmail.com> wrote:
can you explain the purpose of such a parameter for your model?

John Kirwan <jo...@jkirwan.org> schrieb am Mo., 9. Apr. 2018, 14:48:

Dear google-group users,


I am trying to estimate both circular mean (mu) and the precision (kappa) of a circular outcome according to a von Mises distribution with respect to an effect on a linear scale.Both a slope and intercept are estimated for each of mu and kappa, as follows:

 

m1.formula <- bf(radians_error ~ polarization_logged,

kappa ~ polarization_logged) + von_mises()

 

 I am mostly interested in the kappa and I wish to introduce an asymptote parameter into the linear equation for kappa, as follows:


                             kappa ~ polarization_logged + lower_asymptote,

                             lower_asymptote ~ 1)

 

Is this possible for an auxiliary parameter in the brms framework?


Kind regards,

John Kirwan

--
You received this message because you are subscribed to the Google Groups "brms-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brms-users+unsubscribe@googlegroups.com.

John Kirwan

unread,
Apr 11, 2018, 2:08:15 AM4/11/18
to Paul Buerkner, brms-users
Thank you very much for your kind help. One difficulty I have is that when I attempt use the non-linear formulation, as follows:

formula  <- bf( radians ~ polarization, 
                  kappa ~ gamma +  polarization ,
                  gamma ~ 1) + set_nl(TRUE) +
                  von_mises(link = "tan_half", link_kappa = "identity")

brm throws an error: "Error: Some non-linear parameters are missing in formula: 'gamma'" or ... " non-numeric argument to binary operator" if I use nlf()  Is there something obviously incorrect with my syntax?

Kind regards,
John
--
John Kirwan


Tel:       +46 70 680 4647
            +46 46 222 8629
Mail:     jo...@jkirwan.org

Paul Buerkner

unread,
Apr 11, 2018, 2:14:55 AM4/11/18
to John Kirwan, brms-users
with you showing me the nlf() code i obviously cannot tell whats going wrong.

To unsubscribe from this group and stop receiving emails from it, send an email to brms-users+...@googlegroups.com.

To post to this group, send email to brms-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brms-users/1be2166b-8008-41cc-8c29-029170a526e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Paul Buerkner

unread,
Apr 11, 2018, 2:36:22 AM4/11/18
to John Kirwan, brms-users
try out

bf (radians ~ polarization) + nlf(kappa ~ gamma + polarization, gamma ~ 1)

but keep in mind how nonlinear formulas are evaluate in brms.


John Kirwan <jo...@jkirwan.org> schrieb am Mi., 11. Apr. 2018, 08:08:
To unsubscribe from this group and stop receiving emails from it, send an email to brms-users+...@googlegroups.com.

To post to this group, send email to brms-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brms-users/1be2166b-8008-41cc-8c29-029170a526e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

John Kirwan

unread,
Apr 11, 2018, 3:03:20 AM4/11/18
to Paul Buerkner, brms-users
Thank you, this has worked.

To unsubscribe from this group and stop receiving emails from it, send an email to brms-users+unsubscribe@googlegroups.com.

To post to this group, send email to brms-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brms-users/1be2166b-8008-41cc-8c29-029170a526e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
John Kirwan


Tel:       +46 70 680 4647
            +46 46 222 8629
Mail:     jo...@jkirwan.org
Reply all
Reply to author
Forward
0 new messages