Description Usage Arguments Author(s) See Also Examples
Given one-dimensional data dat
and bins bins
, evaluate the
histogram function at x
:
\text{hist}(x) := ∑_{k = 1}^{m} \Big[ \frac{I(x \in B_k)}{n(u_k - u_{k - 1})} ∑_{i = 1}^{n} I(x_i \in B_k) \Big]
1 | histo(x, dat, bins)
|
x |
A number, or vector of numbers. |
dat |
A vector of numbers. |
bins |
A vector of numbers where |
Junkyu Park
csum_N
,
dpmf
,
rpmf
,
Evaluating a hard-to-evaluate pmf using pgf and DFT
1 2 3 4 5 6 7 8 | # Example: dX in csum_N
# Evaluate the histogram of 10000 samples of S = sum of iid X_i ~ dX
# at 0, 1, ..., M - 1 for some integer M, where the endpoints of bins are
# set to be seq(-.5, M - .5, by = 1).
result_X <- csum_N(dX, support = 0:5, lambda = 3)
M <- length(result_X)
samples_N <- rpmf(10000, dpmf, 0:(M - 1), result_X)
histo(0:(M - 1), samples_N, seq(-.5, M - .5, by = 1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.