# Problem computing integrals

Hi all,

This is my first program using Rstan and I am trying to do parameter estimation using attached code herewith and data table. Here K=3 , tstar = 62, n is the number of rows and m is the number of columns of data table.

In my coding , all priors for parameters (b_{0}, \mu, \sigma^{2}, \alpha, \lambda) are uniformly distributed. I tried to use random initial parameter values with default range (-2,2), but fails. I guess this is the error of existing integrations in my code. I have printed parameter values of (\mu, \sigma^{2}, \alpha, \lambda) before the integrations, V1 and I 1 values.

SAMPLING FOR MODEL 'a8424b8efc720602c38a1762d98782f2' NOW (CHAIN 1).
Chain 1:
For V[1],4.41009,0.013401,2.33354,0.207146
v1 = 4.4296e-05
For I[1],56,4.41009,0.013401,2.33354,0.207146
I1 =4.88937e-05
For V[1],4.41009,0.013401,2.33354,0.207146
v1 = 7.58991e-05
For I[1],57,4.41009,0.013401,2.33354,0.207146
I1 =8.01848e-05
For V[1],4.41009,0.013401,2.33354,0.207146
v1 = 0.000125767
For I[1],58,4.41009,0.013401,2.33354,0.207146
I1 =0.000127394
For V[1],4.41009,0.013401,2.33354,0.207146
v1 = 0.000201855
For I[1],59,4.41009,0.013401,2.33354,0.207146
I1 =0.000196368
For V[1],4.41009,0.013401,2.33354,0.207146
v1 = 0.000314262
For I[1],60,4.41009,0.013401,2.33354,0.207146
I1 =0.000294078

Chain 1:
For V[1],4.41009,0.013401,2.33354,0.207146
v1 = 4.4296e-05
For I[1],56,4.41009,0.013401,2.33354,0.207146

Chain 1: Exception: integrate: error estimate of integral 1.06464e+43 exceeds the given relative tolerance times norm of integral  (in 'model20a04589438_a8424b8efc720602c38a1762d98782f2' at line 100)

[1] "Error in sampler\$call_sampler(args_list[[i]]) : "
[2] "  Exception: integrate: error estimate of integral 1.06464e+43 exceeds the given relative tolerance times norm of integral  (in 'model20a04589438_a8424b8efc720602c38a1762d98782f2' at line 100)"
[3] "In addition: Warning message:"
[4] "In system(paste(CXX, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) :"
[1] "error occurred during calling the sampler; sampling not done"


code.R (5.1 KB)

Data Table.csv (217 Bytes)

Thank you all

Sorry it took so long for someone to respond! @bbbales2 or anyone else super familiar with using our integration functions, does this

Chain 1: Exception: integrate: error estimate of integral 1.06464e+43 exceeds the given relative tolerance times norm of integral

imply that that user should change the relative tolerance or that there’s a problem with what’s being input into the integral? Or potentially both?

Oh yeah I saw this but I just assumed it was the same thing as over here: Integrate_1d errors in stan . Was this a different problem?

1 Like

Oh I see, yeah looks like a duplicate, thanks! @evihas If this is actually different definitely let us know so we don’t ignore it!

No this was a same problem. Then I created a new topic.

@jonah please kindly ignore this.

Thank you for your time.

You all are really very helpful.

THANK YOU 👍

1 Like

Ok great, thanks for clarifying. Glad @bbbales2 was able to help you out in that other post!

1 Like