Re: [stan-users] creating a row vector in parameter block in STAN

61 views
Skip to first unread message
Message has been deleted

Michael Betancourt

unread,
Dec 12, 2016, 9:02:01 AM12/12/16
to stan-...@googlegroups.com
No, you can’t.  The max condition introduces a discontinuity
that will compromise the efficacy of the sampling algorithms.
Remember that the scope of the Stan modeling language is
nominally models with continuous probability densities.

On Dec 12, 2016, at 8:06 AM, Tas <t.ta...@gmail.com> wrote:


Hi everyone,

The parameter block of my STAN code looks like:

    real<lower=0> mu;
    real<lower=0,upper=1> k;
    real<lower=1> p;
    real<lower=0> c;
    real<lower=0> alpha;
    real<lower= max(0.00,-alpha/ (k-1)) > beta;

But this shows me the error as:

SYNTAX ERROR, MESSAGE(S) FROM PARSER:

No matches for: 

  max(real, real)

Available argument signatures for max:

  max(int[])
  max(real[])
  max(vector)
  max(row vector)
  max(matrix)
  max(int, int)
  
ERROR at line 54

 52:    real<lower=0> c;
 53:    real<lower=0> alpha;
 54:    real<lower=max(0.00,alpha/(1-k))> beta;
                                        ^
 55:    }

Now I want to create a 2 element row vector whose first element will be "0.00" and second one will be "alpha/(1-k)". Then I will take the maximum of these two elements as the lower bound for "beta". How can I do this?

Tas

--
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.

Tas

unread,
Dec 12, 2016, 9:52:07 AM12/12/16
to Stan users mailing list
Oh!! Thanks.
Reply all
Reply to author
Forward
0 new messages