# Monte-Carlo integration in ICLV models

7 views

### 1049677382

Oct 2, 2021, 7:02:41 AMOct 2
to biogeme
Dear professors:
I'm estimating an ICLV mode including two latent variables. Both random error term of each latent variable is normally distributed. I want to know that if I need to use Monte-Carlo integration (loglike = log(MonteCarlo(condprob))) rather than numerical integration (loglike = log(Integrate(condprob * density, 'omega')))?
In addition, I'm confused about the function of the parameter, numberOfDraws. When I set it equal to 20000,  I found that the solution time is particularly long. However, when I remove this parameter, just use biogeme = bio.BIOGEME(database, loglike) in my code, the solution time will be shorter. But I'm not sure that whether the results in this way is reliable or not. Is the numberOfDraws related to the accuracy of the results?
In my research,  there are about 30 variables to be estimated and the total number of data is N=3905.   What is the appropriate setting for the numberOfDraws?
Best wishes for you.
Zhicheng Jin

### Bierlaire Michel

Oct 2, 2021, 11:21:59 AMOct 2
to 10496...@qq.com, Bierlaire Michel, biogeme

On 2 Oct 2021, at 05:50, '1049677382' via Biogeme <bio...@googlegroups.com> wrote:

Dear professors:
I'm estimating an ICLV mode including two latent variables. Both random error term of each latent variable is normally distributed. I want to know that if I need to use Monte-Carlo integration (loglike = log(MonteCarlo(condprob))) rather than numerical integration (loglike = log(Integrate(condprob * density, 'omega')))?

In general, with more than one random coefficient, I would recommend Monte-Carlo.

In addition, I'm confused about the function of the parameter, numberOfDraws. When I set it equal to 20000,  I found that the solution time is particularly long. However, when I remove this parameter, just use biogeme = bio.BIOGEME(database, loglike) in my code, the solution time will be shorter.

This is because the default value is 1000. See http://biogeme.epfl.ch/sphinx/biogeme.html#biogeme.biogeme.BIOGEME

But I'm not sure that whether the results in this way is reliable or not. Is the numberOfDraws related to the accuracy of the results?

Of course. Usually, I would use a lower number of draws during the development phase of the model, to save time. Once you are happy with the specification, re-estimate it again with a larger number of draws.

In my research,  there are about 30 variables to be estimated and the total number of data is N=3905.   What is the appropriate setting for the numberOfDraws?

There is no golden rule. The larger, the better.