"sample" or "samples"?

17 views
Skip to first unread message

Bob Carpenter

unread,
Aug 29, 2012, 4:08:47 PM8/29/12
to stan...@googlegroups.com
What kind of noun is "sample" in the context
we're using it?

English has three kinds of nouns:

singular count (e.g., student, car)
plural count (e.g., students, cars)
mass (e.g., water, sky)

as well as a fourth minor category of dual nouns
like "scissors" and "pants".

Which determiner (or partitive, like "a lot of")
you use depends on whether something
is a mass or count noun.

much water / * many water
many students / much students

When we sample from a distribution ("sample" is also
a verb), do we get a "single sample"
or "several samples"?

In the manual, I took "sample" to refer to a
complete set of parameter values derived from
a single iteration of HMC/NUTS, so a single chain
produces multiple samples, and a sampler produces
multiple samples in a run, not a single sample.

I could see this going the other way, with
a "sample" referring to a mass of samples of the
kind I talked about, being collective over one or more chains.
This would be like "we took a water sample from
this well" as opposed to "we took samples of the
chips from the production line".

- Bob

Andrew Gelman

unread,
Aug 29, 2012, 5:20:59 PM8/29/12
to stan...@googlegroups.com
A. We have a sample of size 1000 from the posterior distribution.
B. We have 1000 samples from the posterior distribution.

I've seen (and used) both A and B. But I prefer A.
> --
>

Matt Hoffman

unread,
Aug 29, 2012, 5:23:34 PM8/29/12
to stan...@googlegroups.com
To throw in a point that's possibly relevant to internal consistency:
"effective sample size" implies A.

Matt
> --
>
>

Bob Carpenter

unread,
Aug 29, 2012, 5:48:07 PM8/29/12
to stan...@googlegroups.com
(Matt: there's a strong preference for singulars
in noun compounds in English, e.g., "student housing"
not "students housing", even though "student" is clearly
a count noun [well, maybe not for University admins who
deal with them by the pound]).

So if we have four chains, would you prefer

four samples of size 1000

or

one sample of size 4000?

I've prematurely changed all of Jiqiang's
usages of "sample" to "samples" because I
needed to do , but we can go and change them
all back again.

We need another copy-edit pass over every use of
"sample" in our doc to make our usage consistent.
I pretty much uniformly did it the other way.

I'll put that on the cleanup to-do list -- I'm not
going to do it before 1.0.0, though.

- Bob

Andrew Gelman

unread,
Aug 29, 2012, 5:50:46 PM8/29/12
to stan...@googlegroups.com
It's 4 samples of size 1000 and, if combined, 1 sample of size 4000.
> --
>

Matt Hoffman

unread,
Aug 29, 2012, 6:13:02 PM8/29/12
to stan...@googlegroups.com
I still think that effective sample size argues for the mass noun
interpretation, since compound nouns like "student size" or "car size"
unambiguously refer to a single student or car. That said, I also
mostly use sample as a count noun.

Interesting to compare this confusion with the situation in audio
digital signal processing, where "sample" can refer either to a single
measurement of air pressure (as in "44,100 samples per second") or to
a clip "sampled" from a larger audio clip (this sample being comprised
of some number of samples, and being further divisible into a
subsample of a smaller number of samples).

Matt
> --
>
>

Bob Carpenter

unread,
Aug 29, 2012, 6:51:28 PM8/29/12
to stan...@googlegroups.com
On 8/29/12 5:50 PM, Andrew Gelman wrote:
> It's 4 samples of size 1000 and, if combined, 1 sample of size 4000.

Now all I need to know is what to call one of the
1000 thingamajigs that is in a sample of size 1000.

If our one sample of size 1000 is

theta[1], ..., theta[1000]

where each theta[n] is a vector of parameter values,
what do I call the seventh thingamajig, theta[7]?

I was calling theta[7] a sample.

We decided to call the work done in creating a thingamajig
an "iteration." So we might say "the sampler ran for 1000
iterations with the output from 250 of these iterations
used to form a single sample of size 250".

But I can't call theta[7] an iteration, can I? That seems
like a type mistake. I think of an iteration as something an
algorithm does, not something it outputs.

- Bob

Andrew Gelman

unread,
Aug 29, 2012, 7:10:31 PM8/29/12
to stan...@googlegroups.com
We sometimes call that a "draw" or a "simulation".
> --
>

Bob Carpenter

unread,
Aug 29, 2012, 7:20:03 PM8/29/12
to stan...@googlegroups.com


On 8/29/12 7:10 PM, Andrew Gelman wrote:
> We sometimes call that a "draw" or a "simulation".

Thanks. "draw" is just what I was looking for!

I find "simulation" just as gnarly as "sample".

- Bob

Reply all
Reply to author
Forward
0 new messages