Description Usage Arguments Value Note See Also Examples
View source: R/EM.Trapezoidal.R
This function can easily obtain Maximum Likelihood Estimation (MLE) for the unknown one-dimensional parameter on the basis of Trapezoidal Fuzzy observation.
1 2 | EM.Trapezoidal(T.dist, T.dist.par, par.space, c1, c2, l, u, start, ebs=0.001,
fig = 2)
|
T.dist |
the distribution name of the random variable is determined by characteristic element |
T.dist.par |
a vector of distribution parameters with considered ordering in |
par.space |
an interval which is a subset / subinterval of the parameter space and it must be contain the true value of unknown parameter. |
c1 |
a vector with |
c2 |
a vector with |
l |
a vector with |
u |
a vector with |
start |
a real number from |
ebs |
a real positive small number (e.g., 0.01, 0.001 or 0.1^6) which determine the accuracy of EM algorithm in estimation of unknown parameter. |
fig |
a numeric argument which can tack only values 0, 1 or 2. If If If |
The parameter computed / estimated in each iteration separately and also the computation of the following values can be asked directly.
MLE |
the value of maximum likelihood estimated for unknown parameter by EM algorithm based on TrFNs. |
parameter.vector |
a vector of the ML estimated parameter for unknown parameter in algorithm which its first elements |
Iter.Num |
the number of EM algorithm iterations. |
In using this package it must be noted that:
(1) The sample size of TrFNs must be less than 16. This package is able to work with small sample sizes (n ≤q 15) and can be extended by the user if needs.
(2) Considering a suitable interval for par.space
is very important to obtain a true result for EM algorithm. It must be mentioned that this interval must be a sub-interval of the parameter space and the user must check the result of algorithm (MLE). It means that if the obtained MLE (by EM.Trapezoidal
) overlay on the boundary of par.space
, then the result is not acceptable and the EM algorithm must be repeated once again with a wider par.space
.
(3) This package is able to work for continuous distributions with one or two parameter which only one of them is unknown and the user wants to estimate it based on TrFNs.
DISTRIB FuzzyNumbers
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | library(FuzzyNumbers)
library(DISTRIB, warn.conflicts = FALSE)
# Example 1: Estimation the unknown mean of Normal population with known variance (e.g,
# var=0.5^2) based of Trapezoidal FNs.
n = 2
set.seed(1000)
c1 = rnorm(n, 10,.5)
c2 = rnorm(n, 10,.5)
for(i in 1:n) {if (c1[i] > c2[i]) { zarf <- c1[i]; c1[i] <- c2[i]; c2[i] <- zarf }}
round(c1,3); round(c2,3)
c1 <= c2
l = runif(n, 0,1); round(l,3)
u = runif(n, 0,1); round(u,3)
EM.Trapezoidal(T.dist="norm", T.dist.par=c(NA,0.5), par.space=c(-5,30), c1, c2, l, u, start=4,
ebs=.1, fig=2)
# Example 2:
n = 4
set.seed(10)
c1 = rexp(n, 2)
c2 = rexp(n, 2)
for(i in 1:n) {if (c1[i] > c2[i]) { zarf <- c1[i]; c1[i] <- c2[i]; c2[i] <- zarf }}
round(c1,3); round(c2,3)
c1 <= c2
l = runif(n, 0,1); round(l,3)
u = runif(n, 0,2); round(u,3)
EM.Trapezoidal(T.dist="exp", T.dist.par=NA, par.space=c(.1,20), c1, c2, l, u, start=7,
ebs=.001)
# Example 3: Estimation the unknown standard deviation of Normal population with known
# mean (e.g, mean=7) based of Trapezoidal FNs.
n = 10
set.seed(123)
c1 = rnorm(n, 4,1)
c2 = rnorm(n, 4,1)
for(i in 1:n) {if (c1[i] > c2[i]) { zarf <- c1[i]; c1[i] <- c2[i]; c2[i] <- zarf }}
round(c1,3); round(c2,3)
c1 <= c2
l = runif(n, 0,.5); round(l,3)
u = runif(n, 0,.75); round(u,3)
EM.Trapezoidal(T.dist="norm", T.dist.par=c(4,NA), par.space=c(0,40), c1, c2, l, u, start=1,
ebs=.0001, fig=2)
# Example 4: Estimation alpha parameter in Beta distribution.
n = 4
set.seed(12)
c1 = rbeta(n, 2,1)
c2 = rbeta(n, 2,1)
for(i in 1:n) {if (c1[i] > c2[i]) { zarf <- c1[i]; c1[i] <- c2[i]; c2[i] <- zarf }}
round(c1,3); round(c2,3)
c1 <= c2
l = rbeta(n, 1,1); round(l,3)
u = rbeta(n, 1,1); round(u,3)
EM.Trapezoidal(T.dist="beta", T.dist.par=c(NA,1), par.space=c(0,10), c1, c2, l, u, start=1,
ebs=.01, fig=2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.