Description Usage Arguments Value See Also Examples
TSMNmoments
return the first four moments of TSMN distributions, as
example Normal, Student-t, Pearson VII, Slash or Contaminated Normal.
1 2 |
mu |
Location parameter. |
sigma2 |
Scale parameter. |
nu |
Parameter of the scale variable of the SMN family. Must be NULL in case of Normal distribution. Must be a bidimensional vector and each component of the bidimensional vector "nu" must lie on (0,1) in case of contaminated normal distribution (CNormal). |
delta |
Second parameter of Pearson VII. Must not be provided in case of Normal, Student-t or Slash distribution. |
lower |
Lower bounds. |
upper |
Upper bounds. |
dist |
Distribution to be used: "Normal" for Normal model, "T" for Student-t model, "PearsonVII" for Pearson VII model, "Slash" for slash model and "CNormal" for contaminated Normal model. |
The first moment
The second moment
The third moment
The fourth moment
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## A test sample to compare theoretical and empirical moments, considering the following parameters:
mu = 2
sigma2 = 4
nu = 5
lower = -3
upper = 10
dist = "T"
n = 10000
## Theoretical moments with TSMNmoments
theor<-TSMNmoments(mu=mu, sigma2=sigma2, nu=nu, lower=lower, upper=upper, dist=dist)
## Generate the sample with TSMNgenerator to compute the empirical moments
empir<-TSMNgenerator(n=n, mu=mu, sigma2=sigma2, nu=nu, lower=lower, upper=upper, dist=dist)
## Compare the results
data.frame("1st" = c("Theoretic" = theor$EY1, "Empirical" = mean(empir)),
"2nd" = c("Theoretic" = theor$EY2, "Empirical" = mean(empir^2)),
"3rd" = c("Theoretic" = theor$EY3, "Empirical" = mean(empir^3)),
"4th" = c("Theoretic" = theor$EY4, "Empirical" = mean(empir^4)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.