Multiple datasets and missing data

24 views
Skip to first unread message

edwi...@gmail.com

unread,
Oct 27, 2017, 5:58:31 AM10/27/17
to LibBi Users
Hi,

I have two sets of data. One that includes data for every week, the second only has data for the first couple of weeks. At first I just assumed that if there was no data (in the second set) then it would not be included in the likelihood calculation, but I found that instead it will use the last value in the second data set and continue fitting to that. What is the best way to deal with this. I can write a custom pdf() that ignores certain values, but that is not really usable for more complicated distributions. 

I am using libbi through rbi.

Cheers, Edwin

Lawrence Murray

unread,
Oct 27, 2017, 7:41:11 AM10/27/17
to libbi...@googlegroups.com

Hi Edwin,

It sounds as though the second data set may be being treated as an input rather than an observation. You've declared both of your observations with "obs" not "input", and their values are in the observation file not the input file?

Cheers,

Lawrence

--
You received this message because you are subscribed to the Google Groups "LibBi Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to libbi-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Edwin van Leeuwen

unread,
Oct 28, 2017, 9:09:31 AM10/28/17
to Lawrence Murray, libbi...@googlegroups.com
They are defined as obs, but they are used in a pdf() expression, could it be that that causes them to be treated differently?

sebasti...@lshtm.ac.uk

unread,
Nov 26, 2017, 3:49:36 PM11/26/17
to LibBi Users
At the risk of sounding like a broken record, can you post a reproducible example? Also, are you running libbi from RBi or the command line?

Cheers,
  Seb.

Edwin van Leeuwen

unread,
Nov 27, 2017, 3:22:20 AM11/27/17
to sebasti...@lshtm.ac.uk, LibBi Users
I have been able to solve this. I thought it was fine to use input values on the right hand side, but it turns out you should only use obs variables in the observation block, i.e. in:
k ~ binomial(n, p)

both k and n need to be of type obs, while I had assumed only k needed to be obs.

Cheers, Edwin
Reply all
Reply to author
Forward
0 new messages