Re: Question about how to build plate model and reading data from files

28 views
Skip to first unread message

Lei Li

unread,
May 21, 2015, 1:49:35 PM5/21/15
to Chill Yi-I Chiu, blog...@googlegroups.com
Hi Yi-I

1. Yes. You may want to use the built in loadRealMatrix(file name)

2. Yes. It is possible if you define additional variables for those parameters and reuse them.

Cheers,
Lei

> On May 21, 2015, at 10:06 AM, Chill Yi-I Chiu <chill...@gmail.com> wrote:
>
> Hi Lei,
>
> I am a student at NYU and a new user of BLOG. I am currently trying to build a hidden Markov Model with multiple observations and encounter the following problems:
>
> 1. Is that possible to read in a .txt file as the observation?
> 2. I have difficulty specifying multiple parametrized by a same set of parameter. Is there any sample code I could look into? (I have multiple time series observation of the HMM model. I tried to build the model based on the sample hmm.blog provided, but cannot add a different set of S and O both parametrized by the same set of parameters.)
>
> Thank you very much for your help!!
>
> Best,
> Yi-I
>
> --
> Best regards,
> Yi-I Chiu (邱伊禕)
> New York University, MS in Data Science 15'
> cell phone: (646)-659-5271
> e-mail: yic211 AT nyu DOT edu

Lei Li

unread,
May 22, 2015, 2:42:37 AM5/22/15
to Chill Yi-I Chiu, blog...@googlegroups.com
Here is the corrected one.

In your original version, you defined Init as a random variable. Note it is not a distribution. therefore when you use it in the dependency statement of S1, it can not be used as a distribution, but a variable with a value.

Lei

On Thu, May 21, 2015 at 12:22 PM, Chill Yi-I Chiu <chill...@gmail.com> wrote:
Hi Lei,

I am trying to run BLOG with two sequential observations. When I am running the model with some parameters the following error message comes up:

Exception in thread "main" java.lang.IllegalArgumentException: All particles have zero weight
at blog.engine.ParticleFilter.take(ParticleFilter.java:254)
at blog.engine.ParticleFilter.takeEvidenceAndAnswerQuery(ParticleFilter.java:172)
at blog.engine.ParticleFilter.answerQueries(ParticleFilter.java:129)
at blog.Main.run(Main.java:190)
at blog.Main.main(Main.java:153)

I attached my code so you can get an idea on what went wrong.

Thank you again for all the helps.

Best,
Yi-I




On Thu, May 21, 2015 at 1:51 PM, Chill Yi-I Chiu <chill...@gmail.com> wrote:
Hi Lei,

Thanks! I will try it and see if works :)

Best,
Yi-I
hmm.dblog
Reply all
Reply to author
Forward
0 new messages