N mixture model with beta-binomial

491 views
Skip to first unread message

Curtis Burkhalter

unread,
May 24, 2017, 12:33:13 PM5/24/17
to Stan users mailing list
Hello all,

I'm trying to build an build an N mixture model to estimate bird abundance corrected for detection probability. I've seen the STAN 'translations' of the Kery and Schaub code, but my model can't make use of the specified bivariate poisson likelihood provided in that code because I want to use a beta-binomial for the estimation of detection probability due to correlated behavior among observed individuals. I'm running into trouble with the estimation of latent abundance and poisson_lpmf portion of the model. I keep getting the error "parameters or transformed parameters cannot be integer or integer array", but from the STAN ref guide it appears that poisson lpmf needs an integer as the first term.  I'm really unsure of how to get this moving forward and any suggestions would be greatly appreciated. Here is the code that I'm using:

#load required packages
library(rstan)
rstan_options(auto_write = TRUE)
options(mc.cores = 2)
set.seed(123)

## Read data
## The data file "fritilary.txt" is attached
bdat <- read.table("fritillary.txt", header = TRUE)
y <- array(NA, dim = c(95, 2, 7)) # 95 sites, 2 reps, 7 days

for(k in 1:7) {
  sel.rows <- bdat$day == k
  y[, , k] <- as.matrix(bdat)[sel.rows, 3:4]
}
R = nrow(y)
T = ncol(y)
first <- sapply(1:dim(y)[1], function(i)
  min(grep(FALSE, is.na(y[i, 1, ]))))
last <- sapply(1:dim(y)[1], function(i)
  max(grep(FALSE, is.na(y[i, 1, ]))))
y[is.na(y)] <- -1

## Parameters monitored
params <- c("N","lambda","alpha","beta")

## MCMC settings
ni <- 2000
nt <- 1
nb <- 1000
nc <- 1

## Initial values
inits <- lapply(1:nc, function(i)
  list(lambda = runif(7,1,1),N = matrix(runif(R*7,1,1),nrow = 95,ncol =7, byrow=TRUE),alphaP = runif(7,1,1), betaP = runif(7,1,1)))

## Call Stan from R; the code for 'Nmix_adapted_noZI.stan" is pasted below
out1 <- stan("Nmix_adapted_noZI.stan",
             data = list(y = y, R = R, T = 2,K = 100),
             init = inits, pars = params,
             chains = nc, iter = ni, warmup = nb, thin = nt,
             seed = 1,
             control = list(adapt_delta = 0.9),
             open_progress = FALSE)
print(out1, digits = 3)

'Nmix_adapted_noZI'
data {
  int<lower=1> R;                   //Number of sites
  int<lower=1> T;                   //Number of replications; fixed as 2                                       
  int<lower=-1> y[R, 2, 7];         //  Counts (-1:NA)
  int<lower=1,upper=7> first[R];   //  First occasion
  int<lower=1,upper=7> last[R];   //  Last occasion
  int<lower=0> K;                // Upper bounds of population size             
}

transformed data {
  real<lower=0> lambda_mu;           
  real<lower=0> lambda_sig;        
  int<lower=0> max_y[R, 7];
  int<lower=0> max_y_site[R];
  
  for (i in 1:R) {
    for (k in 1:(first[i] - 1))
      max_y[i, k] = 0;
    for (k in (last[i] +1 ):7)
      max_y[i, k] = 0;
    for (k in first[i]:last[i])
      max_y[i, k] = max(y[i, 1:T, k]);
      max_y_site[i] = max(max_y[i]);
  }
  lambda_mu = 0;
  lambda_sig = 10;
}

parameters {
 int N[R,7];
  vector[7] alphaP;               
  vector[7] betaP;      
  vector[7] lambda;
}

model {
  // Priors

  // Likelihood
  for (i in 1:R) {
        for (k in first[i]:last[i]) {
        lambda[k] ~ normal(lambda_mu,lambda_sig);
        poisson_lpmf(N[i,k] | lambda[k]) 
        + beta_binomial_lpmf(y[i, 1:T, k] | N[i,k], alphaP[k], betaP[k]);
        target += log_sum_exp(lp);
         
        }
  }
}

generated quantities {
  
  for (k in 1:7) {
    totalN[k] = sum(N[,k])
    p.derived[k] = alphaP[k]/(alphaP[k]+betaP[k]) #derived detection probability
    rho.derived[k] = 1/(alphaP[k]+alphaP[k])   #derived correlation coefficient
    }
}

Thanks in advance for any help
fritillary.txt

Bob Carpenter

unread,
May 24, 2017, 2:16:01 PM5/24/17
to stan-...@googlegroups.com
Stan (it's not an acronym) doesn't support integer parameters, so this
is illegal:

parameters {
int N[R,7];

You need to marginalize out all the discrete parameters.
There's a chapter in the manual with a bunch of examples of how
to do that. If you have unknown count parameters, you can't do
that in Stan.

Also, this is free floating, so I'm not sure what you were
trying to do:

> poisson_lpmf(N[i,k] | lambda[k])
> + beta_binomial_lpmf(y[i, 1:T, k] | N[i,k], alphaP[k], betaP[k]);

Usually that would come with a target += to add the term to the log
density. But like I said, if that N is an unkown count parameter, as coded here,
you're not going to be able to make this work in Stan as written.

If you can create a reasonably small bound on N outside of which there's
negligible probably mass (say N < 20 or so), you can marginalize over
that range.

- Bob
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
> <fritillary.txt>

Curtis Burkhalter

unread,
May 24, 2017, 4:19:54 PM5/24/17
to stan-...@googlegroups.com
Thanks for the help Bob. I've gone back to look at the manual and I've tried to adapt the code accordingly. When I run the code now I get an error that states "no parameter N, alpha, beta; sampling not done", which doesn't make sense to me because I don't use those terms anywhere in the code. 

I've pasted my updated code here:

#load required packages
library(rstan)
rstan_options(auto_write = TRUE)
options(mc.cores = 2)
set.seed(123)

#set working directory
setwd("~/Personal GHub/STAN-MSAM")

## Read data
## The data file "fritilary.txt" is available at
bdat <- read.table("fritillary.txt", header = TRUE)
y <- array(NA, dim = c(95, 2, 7)) # 95 sites, 2 reps, 7 days

for(k in 1:7) {
  sel.rows <- bdat$day == k
  y[, , k] <- as.matrix(bdat)[sel.rows, 3:4]
}
R = nrow(y)
T = ncol(y)
first <- sapply(1:dim(y)[1], function(i)
  min(grep(FALSE, is.na(y[i, 1, ]))))
last <- sapply(1:dim(y)[1], function(i)
  max(grep(FALSE, is.na(y[i, 1, ]))))
y[is.na(y)] <- -1

## Parameters monitored
params <- c("N","lambda","alpha","beta")

## MCMC settings
ni <- 2000
nt <- 1
nb <- 1000
nc <- 1

## Initial values
inits <- lapply(1:nc, function(i)
  list(lambda = runif(7,1,1),P_alpha = runif(7,1,1), P_beta = runif(7,1,1)))

## Call Stan from R
out1 <- stan("Nmix_noZI_52417.stan",
             data = list(y = y, R = R, T = 2,K = 100),
             init = inits, pars = params,
             chains = nc, iter = ni, warmup = nb, thin = nt,
             seed = 1,
             control = list(adapt_delta = 0.9),
             open_progress = FALSE)
print(out1, digits = 3)

Nmix_noZI_52417

data {
  int<lower=1> R;                   //Number of sites
  int<lower=1> T;                   //Number of replications; fixed as 2                                       
  int<lower=-1> y[R, 2, 7];         //  Counts (-1:NA)
  int<lower=1,upper=7> first[R];   //  First occasion
  int<lower=1,upper=7> last[R];   //  Last occasion
  int<lower=0> K;                // Upper bounds of population size             
}

transformed data {
  real<lower=0> lambda_mu;           
  real<lower=0> lambda_sig;        
  int<lower=0> max_y[R, 7];
  int<lower=0> max_y_site[R];
  
  for (i in 1:R) {
    for (k in 1:(first[i] - 1))
      max_y[i, k] = 0;
    for (k in (last[i] +1 ):7)
      max_y[i, k] = 0;
    for (k in first[i]:last[i])
      max_y[i, k] = max(y[i, 1:T, k]);
      max_y_site[i] = max(max_y[i]);
  }
  lambda_mu = 0;
  lambda_sig = 10;
}

parameters {
  vector[7] P_alpha;               
  vector[7] P_beta;      
  vector[7] lambda;
}

transformed parameters {
  vector[R] lp;
  for (i in 1:R) {
        for (k in first[i]:last[i]) {
          for (n in 1:20) {
        lp[R] = poisson_lpmf(n | lambda[k]) 
        + beta_binomial_lpmf(y[i, 1:T, k] | n, P_alpha[k], P_beta[k]);
          }
      }
   }
}
model {
  // Priors

  // Likelihood
        for (k in 1:7){
              lambda[k] ~ normal(lambda_mu,lambda_sig);
        }
        target += log_sum_exp(lp);
}

Thanks


> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.

> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
> <fritillary.txt>

--
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.

To post to this group, send email to stan-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Curtis Burkhalter
Postdoctoral Research Associate, National Audubon Society

Andrew Gelman

unread,
May 24, 2017, 4:24:21 PM5/24/17
to stan-...@googlegroups.com
I'm guessing you didn't save your new Stan model in the right directory, or something like that.
A

To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.

Ben B

unread,
May 24, 2017, 4:28:20 PM5/24/17
to stan-...@googlegroups.com
"no parameter N, alpha, beta; sampling not done" is probably caused by the params you're passing in to Stan. N, alpha, and beta aren't parameters in the model.

params <- c("N","lambda","alpha","beta") # Probably don't want this


out1 <- stan("Nmix_noZI_52417.stan",
             data = list(y = y, R = R, T = 2,K = 100),
             init = inits, pars = params, # Or this
             chains = nc, iter = ni, warmup = nb, thin = nt,
             seed = 1,
             control = list(adapt_delta = 0.9),
             open_progress = FALSE)

Ben

To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.

To post to this group, send email to stan-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

Curtis Burkhalter

unread,
May 24, 2017, 4:48:34 PM5/24/17
to stan-...@googlegroups.com
Good call, that's cleared up now. I have something going on with my initial values though so I've got to get back to that and see what's going on there. 

Thanks

Ben B

unread,
May 24, 2017, 5:00:33 PM5/24/17
to stan-...@googlegroups.com
Out of curiosity, is there some issue you're trying to address with the initial values?

It's usually easier to just let Stan handle this.

Ben

Curtis Burkhalter

unread,
May 25, 2017, 10:00:52 AM5/25/17
to stan-...@googlegroups.com
Ben, 

I guess I'm used to having to specify your own initial values coming from BUGS. This is the first model I've tried to code in Stan and it's proving to be rather difficult. 

I removed the initial values statement, but this gives the following error:

Error evaluating the log probability at the initial value.

Initialization between (-2, 2) failed after 100 attempts. 
 Try specifying initial values, reducing ranges of constrained values, or reparameterizing the model.
[1] "Error in sampler$call_sampler(args_list[[i]]) : Initialization failed."
[1] "error occurred during calling the sampler; sampling not done"

I have again tried specifying initial values and I have reduced the range of the only constrained parameter, but I can't seem to get past the initialization step. Any suggestions would be greatly appreciated. 

Best

Ben B

unread,
May 25, 2017, 10:31:28 AM5/25/17
to stan-...@googlegroups.com
You should put constraints on lambda, P_alpha, and P_beta to ensure they'll work with the distributions. For the Poisson, lambda > 0, and for the Beta binomial alpha > 0 and beta > 0. It's always worth checking the domains of the different distributions in the back of the manual to make sure you're thinking about the right parameterization when you write your code.

So that means:

  vector<lower=0.0>[7] P_alpha;               
  vector<lower=0.0>[7] P_beta;      
  vector<lower=0.0>[7] lambda;

Usually the error you're getting is a constraint going wrong somewhere.

Hope that works for you!

Ben


Curtis Burkhalter

unread,
May 25, 2017, 10:43:34 AM5/25/17
to stan-...@googlegroups.com
Thanks for the suggestion Ben, I previously set those constraints before my previous post b/c I knew that drawing a 0 for lambda from the hyperprior would result in result of -Inf when evaluated on the log scale. The weird thing is even with the constraints of:
vector<lower=0.01>[7] P_alpha;               
vector<lower=0.01>[7] P_beta;      
vector<lower=0.01>[7] lambda;

I still get the error message:
Rejecting initial value:
  Log probability evaluates to log(0), i.e. negative infinity.
  Stan can't start sampling from this initial value.

I'm thinking there is something wrong with the model specification, but I'm really not sure what it is right now.

Best

Ben B

unread,
May 25, 2017, 11:42:33 AM5/25/17
to stan-...@googlegroups.com
So I'll point out some syntax stuff, but I haven't spent a lot of time with mixture models so you'll want to look elsewhere for advice (moving this thread to http://discourse.mc-stan.org/ might get you more attention -- make sure and send a note here if you move it though).

I think you should approach this problem more from a modeling standpoint. Look around for examples and stuff that look like the thing you're doing and adapt them bit by bit. It's easy to get distracted by these code things (and even if you can fix them you usually end up with a bad model anyway).

There are a few things that are suspicious to me.

First in:

  for (i in 1:R) {
        for (k in first[i]:last[i]) {
          for (n in 1:20) {
        lp[R] = poisson_lpmf(n | lambda[k]) ...

lp[R] is probably supposed to be lp[i] (R is a constant)

Secondly,
lp[R] is getting overwritten in the inner loops, so only the last assignment (k == last[i] and n == 20) would do anything. You have N mixtures, right? So you probably want lp to be length N, however you end up building it.

Third, and I dunno if this is being violated cause I'm not sure what the data is, but the other constraint for the beta_binomial is for:

n ~ beta_binomial(N, alpha, beta)

n is an integer [0, N]

For line in your code:
beta_binomial_lpmf(y[i, 1:T, k] | n, P_alpha[k], P_beta[k])

The 'N' argument (n in this case) comes from a for loop above it. Given y isn't being indexed by 'n', I'm scared this condition might get broken as well.

But it's probly worth starting with a simpler mixture model and focus on getting that right rather than focusing on these problems (they might just be rabbit holes). Good luck!

Ben

Curtis Burkhalter

unread,
May 25, 2017, 12:24:48 PM5/25/17
to stan-...@googlegroups.com
Thanks again Ben. I think starting over with a simpler model might be the way to go at this point. 

This idea of marginalizing out the discrete variables also confuses me, so unfortunately this is playing a large part in my difficulties in getting this model to run. I've always run Bayesian models in BUGS so I've never had to perform this marginalization step and to be totally honest I don't fully understand why/how this works for discrete variables.

Best

Bob Carpenter

unread,
May 25, 2017, 5:09:00 PM5/25/17
to stan-...@googlegroups.com
Look at the manual chapter on marginalizing discrete parameters.
It's the law of total probability:

p(a) = SUM_b p(a, b)

That's it. The trick is to (a) do it with arithmetic stability [you
need log_sum_exp to keep everything on the log scale] and (b) do the
algebra so that the combinatorics don't blow up.

So if you have something like

p(a, theta) = bernoulli(a | theta) * p(thteta)

then

p(theta) = SUM_{a in {0, 1}} bernoulli(a | theta) * p(theta)

For what it's worth, you'll find the models you're fitting will
be *way* faster and more robust in BUGS if you marginalize out the
discrete parameters.

Stan's way better than BUGS at converging from diffuse initializations,
so the user almost never has to supply inits.

- Bob
>> > To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
>> > To post to this group, send email to stan-...@googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>> > <fritillary.txt>
>>
>> --
>> You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.
>> To post to this group, send email to stan-...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Curtis Burkhalter
>> Postdoctoral Research Associate, National Audubon Society
>>
>> https://sites.google.com/site/curtisburkhalter/
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
>> To post to this group, send email to stan-...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> Curtis Burkhalter
> Postdoctoral Research Associate, National Audubon Society
>
> https://sites.google.com/site/curtisburkhalter/
>
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> Curtis Burkhalter
> Postdoctoral Research Associate, National Audubon Society
>
> https://sites.google.com/site/curtisburkhalter/
>
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> Curtis Burkhalter
> Postdoctoral Research Associate, National Audubon Society
>
> https://sites.google.com/site/curtisburkhalter/
>
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.

Curtis Burkhalter

unread,
May 25, 2017, 5:17:15 PM5/25/17
to stan-...@googlegroups.com
Thanks for the explanation Bob, I'll have to work this to try and figure it out.

Best

>> > To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.

>> > To post to this group, send email to stan-...@googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>> > <fritillary.txt>
>>
>> --
>> You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.

>> To post to this group, send email to stan-...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Curtis Burkhalter
>> Postdoctoral Research Associate, National Audubon Society
>>
>> https://sites.google.com/site/curtisburkhalter/
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.

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

> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.

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

> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.

> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> Curtis Burkhalter
> Postdoctoral Research Associate, National Audubon Society
>
> https://sites.google.com/site/curtisburkhalter/
>
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.

> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.

> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> Curtis Burkhalter
> Postdoctoral Research Associate, National Audubon Society
>
> https://sites.google.com/site/curtisburkhalter/
>
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.

> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.

> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> Curtis Burkhalter
> Postdoctoral Research Associate, National Audubon Society
>
> https://sites.google.com/site/curtisburkhalter/
>
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.

> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.

Bob Carpenter

unread,
May 26, 2017, 1:09:00 AM5/26/17
to stan-...@googlegroups.com
You might want to grab a probability theory textbook or follow
a tutorial online --- they all start with the basic rules of probability.
We're not doing anything unusual here.

We can help with specific coding problems.

- Bob
> >> > To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
> >> > To post to this group, send email to stan-...@googlegroups.com.
> >> > For more options, visit https://groups.google.com/d/optout.
> >> > <fritillary.txt>
> >>
> >> --
> >> You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
> >> To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
> >> To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.
> >> To post to this group, send email to stan-...@googlegroups.com.
> >> For more options, visit https://groups.google.com/d/optout.
> >>
> >>
> >>
> >> --
> >> Curtis Burkhalter
> >> Postdoctoral Research Associate, National Audubon Society
> >>
> >> https://sites.google.com/site/curtisburkhalter/
> >>
> >> --
> >> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
> >> To post to this group, send email to stan-...@googlegroups.com.
> >> For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
> > To post to this group, send email to stan-...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
> > To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.
> > To post to this group, send email to stan-...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> > --
> > You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
> > To post to this group, send email to stan-...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
> > To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.
> > To post to this group, send email to stan-...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> >
> >
> > --
> > Curtis Burkhalter
> > Postdoctoral Research Associate, National Audubon Society
> >
> > https://sites.google.com/site/curtisburkhalter/
> >
> > --
> > You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
> > To post to this group, send email to stan-...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
> > To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.
> > To post to this group, send email to stan-...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> >
> >
> > --
> > Curtis Burkhalter
> > Postdoctoral Research Associate, National Audubon Society
> >
> > https://sites.google.com/site/curtisburkhalter/
> >
> > --
> > You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
> > To post to this group, send email to stan-...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
> > To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.
> > To post to this group, send email to stan-...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> >
> >
> > --
> > Curtis Burkhalter
> > Postdoctoral Research Associate, National Audubon Society
> >
> > https://sites.google.com/site/curtisburkhalter/
> >
> > --
> > You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
> > To post to this group, send email to stan-...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.

Curtis Burkhalter

unread,
May 26, 2017, 6:06:36 AM5/26/17
to stan-...@googlegroups.com
Thanks Bob, if I have any more specific coding questions I'll make sure to ask.

Best

> >> > To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.

> >> > To post to this group, send email to stan-...@googlegroups.com.
> >> > For more options, visit https://groups.google.com/d/optout.
> >> > <fritillary.txt>
> >>
> >> --
> >> You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
> >> To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
> >> To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.

> >> To post to this group, send email to stan-...@googlegroups.com.
> >> For more options, visit https://groups.google.com/d/optout.
> >>
> >>
> >>
> >> --
> >> Curtis Burkhalter
> >> Postdoctoral Research Associate, National Audubon Society
> >>
> >> https://sites.google.com/site/curtisburkhalter/
> >>
> >> --
> >> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.

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

> > To post to this group, send email to stan-...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
> > To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.

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

> > To post to this group, send email to stan-...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
> > To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.

> > To post to this group, send email to stan-...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> >
> >
> > --
> > Curtis Burkhalter
> > Postdoctoral Research Associate, National Audubon Society
> >
> > https://sites.google.com/site/curtisburkhalter/
> >
> > --
> > You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.

> > To post to this group, send email to stan-...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
> > To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.

> > To post to this group, send email to stan-...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> >
> >
> > --
> > Curtis Burkhalter
> > Postdoctoral Research Associate, National Audubon Society
> >
> > https://sites.google.com/site/curtisburkhalter/
> >
> > --
> > You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.

> > To post to this group, send email to stan-...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
> > To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.

> > To post to this group, send email to stan-...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> >
> >
> > --
> > Curtis Burkhalter
> > Postdoctoral Research Associate, National Audubon Society
> >
> > https://sites.google.com/site/curtisburkhalter/
> >
> > --
> > You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.

> > To post to this group, send email to stan-...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.

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

> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/ks-72i4KxhQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.

To post to this group, send email to stan-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages