mo_t | R Documentation |
This function computes the moments of order statistics from the student's t-distribution using simulation.
mo_t(r, n, k = 1, df, rep = 1e+05, seed = 42)
r |
rank of the desired order statistic (e.g., |
n |
sample size from which the order statistic is derived. |
k |
order of the moment to compute (default is |
df |
degrees of freedom for the student's t-distribution. |
rep |
number of simulations (default is |
seed |
optional seed for random number generation to ensure reproducibility (default is |
This function estimates the k
th moment of the r
th order statistic in a sample of size n
drawn from a student's t-distribution with the specified degrees of freedom (df
).
The estimation is done via Monte Carlo simulation using the formula:
\text{E}[X^k] \approx \frac{1}{\mathrm{rep}} \sum_{i=1}^{\mathrm{rep}} X_i^k,
where X_i
are the simulated order statistics obtained from the student's t-distribution.
The function relies on the ros()
function to generate order statistics.
The estimated k
th moment of the r
th order statistic from a student's t-distribution.
The accuracy of the estimated moment depends on the number of simulations (rep
).
The default value rep = 1e5
provides a reasonable trade-off between speed and accuracy
for most practical cases. For higher order moments or when greater precision is required,
users are encouraged to increase rep
(e.g. 1e6
).
ros
# Compute the first moment (mean) of the 3rd order statistic from a sample of size 10
mo_t(r = 3, n = 10, df = 5, k = 1)
# Compute the second moment of the 2nd order statistic with 10000 simulations
mo_t(r = 2, n = 10, df = 10, k = 2, rep = 1e4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.