Description Usage Arguments Value Author(s) References See Also Examples
View source: R/simDegrossData.R
Simulation of grouped data and their sample moments to illustrate the degross density estimation procedure
1 | simDegrossData(n, plotting=TRUE, choice=2, J=3)
|
n |
Desired sample size |
plotting |
Logical indicating whether the histogram of the simulated data should be plotted. Default: FALSE |
choice |
Integer in 1:3 indicating from which mixture of distributions to generate the data |
J |
Number of big bins |
A list containing tabulated frequencies and central moments of degrees 1 to 4 for data generated using a mixture density. This list contains :
n
:
total sample size.
J
:
number of big bins.
Big.bins
:
vector of length J+1
with the big bin limits.
freq.j
:
vector of length J
with the observed big bin frequencies.
m.j
:
J
by 4
matrix with on each row the observed first four sample central moments within a given big bin.
true.density
:
density of the raw data generating mechanism (to be estimated from the observed grouped data).
true.cdf
:
cdf of the raw data generating mechanism (to be estimated from the observed grouped data).
Philippe Lambert p.lambert@uliege.be
Lambert, P. (2021) Moment-based density and risk estimation from grouped summary statistics. arXiv:2107.03883.
1 2 3 4 5 6 7 | ## Generate data
sim = simDegrossData(n=3500, plotting=TRUE, choice=2, J=3)
print(sim$true.density) ## Display density of the data generating mechanism
# Create a degrossData object
obj.data = with(sim, degrossData(Big.bins=Big.bins, freq.j=freq.j, m.j=m.j))
print(obj.data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.