The index to the manual lists all the functions, so there's
no need to guess. The language will also report all the legal
signatures for a function you try.
The next release (2.15, which is in the pipeline now), will let
you write:
vector[2] L = [3, 5]';
where [3, 5] is a row vector and ' is the postfix transpose operator.
With 2.14, the closest you can get is:
vector[2] L = to_vector({3, 5});
which uses the {3, 5} to construct an int[] and
then to_vector(int[]) to produce a vector.
If we eventually want a flattening operator like R's c(),
that'll be something completely different:
> c(c(1, 2, 3), 4)
[1] 1 2 3 4
> c(c(1, 2), c(3, 4))
[1] 1 2 3 4
>
In Stan, if you do { { 1, 2 }, { 3, 4 } }, you're going to
get a 2 x 2 array.
- Bob
> On Apr 7, 2017, at 2:42 PM, Trung Dung Tran <
trungd...@gmail.com> wrote:
>
> Hi,
>
> I follow a discussion from 2015 in this link started with Andrew. My email in this series looks like it open a new discussion so it is difficult to guess my question.
>
> Suppose we have vector L length 2. I want to assign
>
> L=c(3, 5) as in R or L=append(3, 5) but I tried both but failed.
>
> Tran.
>
> On 7 April 2017 at 20:26, Marco Inacio <
marcoig...@gmail.com> wrote:
> I think what Tran actually wants is somekind of anonymous vector/array creation like:
>
> [scalar_one, scalar_two, scalar_three]
>
>
>
> On 07/04/2017 14:24, Bob Carpenter wrote:
> It's impossible to help without more context on what the
> variable types are that you're trying to manipulate.
> All of the available function signatures are listed in the
> index of the manual and in the error messages from Stan.
>
> - Bob
>
> On Apr 7, 2017, at 5:22 AM, Tran <
trungd...@gmail.com> wrote:
>
> Hi all,
>
> Do we have something to deal with scalars because when I try
>
> latent_xieta[i, 1 : 2] = append_col(xi_raw[k], eta_raw[k]);
>
> for two scalars it does not work.
>
> Thanks,
> Tran.
>
> --
> 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 unsubscribe from this group and all its topics, send an email to
stan-users+...@googlegroups.com.
> 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.