Specifying hyperpriors

74 views
Skip to first unread message

Helton Maciel

unread,
Nov 4, 2017, 2:30:01 PM11/4/17
to brms-users

I was trying to build a hierarchical model without explicitly specifying the groups in data.  For this i want to use hyperpriors, but i couldn't figured out how to do this in the brms package.

P.S. i'm new to hierarchical modelling, so maybe i'm just missing some point.

Paul Buerkner

unread,
Nov 4, 2017, 2:48:56 PM11/4/17
to Helton Maciel, brms-users
You need to explain your model in some more detail. Otherwise it is hard to help you.

2017-11-04 19:30 GMT+01:00 Helton Maciel <helton....@gmail.com>:

I was trying to build a hierarchical model without explicitly specifying the groups in data.  For this i want to use hyperpriors, but i couldn't figured out how to do this in the brms package.

P.S. i'm new to hierarchical modelling, so maybe i'm just missing some point.

--
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.
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/cf24ef0c-3618-40a4-b198-e6052a0ec7b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Helton Maciel

unread,
Nov 4, 2017, 3:01:30 PM11/4/17
to brms-users

########## Model definition ####################################################
nlform
<- bf(GOL ~  1 - exp(-(k1+k2*V2+k3*V3+k4*V4)*(V5^n)*
                        exp
(-(E1+E2*V2+E3*V3+E4*V4)*
                       
(800-V1)/(800*V1)) /((CF^V7)*V6)^(a)) +
                       
(5.938068  + 2.066451*V9 + 0.258684*v10*V9 -0.226948*V9*v11 -
                         
0.347305*(V9^2))/100,k1+k2+k3+k4+n+E1+E2+E3+E4+CF+a ~ 1,nl = TRUE)


######### Priors ####################################
nlprior
<- c(prior(normal(0,1),nlpar = "k1"),
             prior
(normal(0,1),nlpar = "k2"),
             prior
(normal(0,1),nlpar = "k3"),
             prior
(normal(0,1),nlpar = "k4"),
             prior
(normal(0,1),nlpar = "n"),
             prior
(normal(0,1000),nlpar = "E1"),
             prior
(normal(0,1000),nlpar = "E2"),
             prior
(normal(0,1000),nlpar = "E3"),
             prior
(normal(0,1000),nlpar = "E4"),
             prior
(normal(5,10),nlpar = "CF"),
             prior
(normal(0,1),nlpar = "a"))

######### Fitting #####################################

fit1
<- brm(formula = nlform, data = Dados , family = gaussian(),
            prior
= nlprior,iter = 5000,cores = 3,chains = 3, control = list(adapt_delta=0.98,max_treedepth = 15))
Digite o código aqui...

This is the code for the model.

What i'm trying to do is instead of giving the prior for the parameter "CF", give hyperpriors.

something like this:

prior(normal(0,10),nlpar = "muCF"),
prior(normal(0,10),nlpar = "sigmaCF"),
prior(normal(muCF,sigmaCF),nlpar = "muCF"),
Message has been deleted

Paul Buerkner

unread,
Nov 4, 2017, 3:39:12 PM11/4/17
to Helton Maciel, brms-users
I am afraid, it is currently not possible in the brms framework to specify that sort of hyperpriors.

Your model looks pretty complex. What kind of research question are you trying to answer with it?

2017-11-04 20:02 GMT+01:00 Helton Maciel <helton....@gmail.com>:


Em sábado, 4 de novembro de 2017 16:48:56 UTC-2, Paul Buerkner escreveu:
You need to explain your model in some more detail. Otherwise it is hard to help you.
2017-11-04 19:30 GMT+01:00 Helton Maciel <helton....@gmail.com>:

I was trying to build a hierarchical model without explicitly specifying the groups in data.  For this i want to use hyperpriors, but i couldn't figured out how to do this in the brms package.

P.S. i'm new to hierarchical modelling, so maybe i'm just missing some point.

--
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/cf24ef0c-3618-40a4-b198-e6052a0ec7b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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.
To post to this group, send email to brms-...@googlegroups.com.

Helton Maciel

unread,
Nov 4, 2017, 4:07:34 PM11/4/17
to brms-users
Humm... thanks. At least i can use brms to make a stan code for me and edit later. Congrats on the package by the way.

I'm modelling the kinetic behaviour of thermal craking reactions of petroleum residues in order to predict product yields for industrial plants.

Paul Buerkner

unread,
Nov 4, 2017, 4:28:47 PM11/4/17
to Helton Maciel, brms-users
Sounds complicated ;-)

The reason, you cannot define such hyperparameters currently, is that brms has no mechanism to add additional parameters not featured by brms directly.
This may be added in the future but wll require some time and thought.



2017-11-04 21:07 GMT+01:00 Helton Maciel <helton....@gmail.com>:
Humm... thanks. At least i can use brms to make a stan code for me and edit later. Congrats on the package by the way.

I'm modelling the kinetic behaviour of thermal craking reactions of petroleum residues in order to predict product yields for industrial plants.
--
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.
To post to this group, send email to brms-...@googlegroups.com.

Helton Maciel

unread,
Nov 4, 2017, 5:05:12 PM11/4/17
to brms-users
I see. That feature would be great addition to an already great package.
Reply all
Reply to author
Forward
0 new messages