Bayesian Approach for Confidence Intervals of Variance on the Normal Distribution

is research aims to compare estimating the condence intervals of variance based on the normal distribution with the primary method and the Bayesian approach. e maximum likelihood is the well-known method to approximate variance, and the Chisquared distribution performs the condence interval. e central Bayesian approach forms the posterior distribution that makes the variance estimator, which depends on the probability and prior distributions. Most introductory prior information looks for the availability of the prior distribution, informative prior distribution, and noninformative prior distribution. e gamma, Chisquared, and exponential distributions are dened in the prior distribution. e informative prior distribution uses the Markov Chain Monte Carlo (MCMC) method to draw the random sample from the posterior distribution. e Fisher information performs theWald condence interval as the noninformative prior distribution.e interval estimation of the Bayesian approach is obtained from the central limit theorem. e performance of these methods considers the coverage probability and minimum value of the average width. e Monte Carlo process simulates the data from a normal distribution with the true parameter of mean and several variances and the sample sizes. e R program generates the simulated data repeated 10,000 times in each situation. e results showed that the maximum likelihood method employed on the small sample sizes. e best condence interval estimation was when sample sizes increased the Bayesian approach with an available prior distribution. Overall, the Wald condence interval tended to outperform the large sample sizes. For application in real data, we expressed the reported airborne particulate matter of 2.5 in Bangkok, ailand. We used the 10–1000 records to estimate the condence interval of variance and evaluated the interval width. e results are similar to those of the simulation study.


Introduction
Statistical inference is the process of using detailed statistics on the observation data set (i.e., the mean and the variance), called a statistic, that refer to the properties of the parameter with the population. It assumes that the observed data set is a random sample from a large population. Parameter estimation and hypothesis testing are part of statistical inference related to a statistic and the parameter. e parameter estimation consists of point and interval estimations. Point estimation contains a single value for estimating the population parameter or called an estimator by using the sampled data, a single number. Some error is associated with the point estimator that may be smaller or larger than the true parameter. Instead of a point estimate, con dence interval estimation uses the sampled data to approximate the range of lower and upper bounds of the population parameter. e desire of con dence interval is computed by the mean of the estimators from point estimation plus and minus the variation in that estimate based on the con dence level. e normal distribution is a continuous probability distribution consisting of parameters, namely mean and variance, which is often used in the natural and social sciences. One important parameter of the normal distribution is the variance that measures the dispersion of the data set around its mean. In statistics, variance can be computed by taking the sum of the squared di erences dispersed around the mean and dividing by the total sample sizes and then squaring the di erences to make them positive.
Several tools are available for estimated variance using sample data: the moments method, maximum likelihood method, least-squares method, and Bayesian method. e maximum likelihood method is a primary method for estimating the parameter of probability distribution function given observation. e estimator is approximated by maximizing the likelihood function given the parameter. e maximum likelihood estimator is an interesting method because most estimators present in a class of a minimum variance unbiased estimator [1]. en, the variance estimator from the maximum likelihood method is used to create the interval estimation from Chi-squared statistics [2]. Smithpreecha and Niwitpong [3] presented four approaches to construct confidence intervals for the common variance of normal distributions and compared the results based on the generalized confidence intervals. Iliopoulos and Kourouklis [4] constructed a confidence interval for the generalized variance of a matrix normal distribution with unknown mean and improved on the usual minimum size.
e Bayesian approach method mentions the probability distribution given the parameter related to the prior distribution. Resolution of the prior distribution impacts obtaining the posterior distribution [5]. e case of the prior distribution is defined as the available prior distribution, informative prior distribution, and noninformative prior distribution. e posterior distribution is estimated by the available prior information shown in the appropriate distribution. So, the Bayesian estimator is obtained from the mean of the posterior distribution. Severini [6] studied the relationship between Bayesian and non-Bayesian confidence intervals by deriving asymptotic extensions of the posterior probability for computing the confidence regions based on the likelihood ratio test statistics. Next, Severini [7] was interested in creating an interval estimate for the population parameter and constructed the posterior probability such that the parameter lays in the interval in some specified value. Ali and Riaz [8] studied the Bayesian methodology for designing Bayesian control charts and noticed that the performance of the Bayesian charts is biased. e computer algorithm has been developed to draw a random sample from the posterior distribution in an informative prior distribution [9]. Most used the Markov Chain Monte Carlo (MCMC) [10] method as an informative prior distribution because it can draw an approximate sample from the prior distribution. en, Gibbs sampling [11] is a process of MCMC to generate the sample values from the posterior distribution. e conjugate prior is the same family as the prior and posterior distributions. e construction of the posterior distribution is in a closed form of conjugate distribution that is made to approximate the MCMC estimator. Atchadé [12] constructed the confidence interval for the asymptotic variance and proposed that the confidence interval converges to standard central limit theorems for the Markov chains. Mahmoud et al. [13] proposed Markov Chain Monte Carlo techniques to compute the maximum likelihood estimation and the confidence intervals of coefficient of variation. e approximation of the confidence interval of variance [14] is studied by using the sample sum of squared deviations from the mean. e confidence interval of minimum length is raised concerning the shortest unbiased interval for the variance of a normal distribution. Typically, the estimated confidence interval of variance is used in the Chi-squared distribution to create the lower and upper bounds. eir importance is partly due to the central limit theorem. Rajić and Stanojević [15] considered the confidence intervals for the ratio of two variances. e F-statistic and central limit theorem proposed the confidence interval. e central limit theorem proposes the Bayesian of the available and informative prior distributions, which performs the confidence interval using the mean and variance from the posterior distribution. Abu-Shawiesh et al. [16] approximated asymptotic confidence interval for the population of standard deviation based on the sample Gini mean difference.
Another problem with the prior information is that if the parameter of the prior distribution is entirely appropriate, it should be incorporated into the posterior distribution. is is not a severe problem since the noninformative prior distribution leads to discussion. Kass and Wasserman [17] stated two different interpretations of noninformative priors. e ignorance of noninformative priors was formal representations, and the prior distribution was defined as the constant value when there is insufficient information. Andrés andÁlvarez Hernández [18] evaluated the confidence interval on noninformative prior distribution from Jeffrey's Bayesian method.
e Wald method was determined to create the confidence interval of a binomial proportion. Agresti and Coull [19] suggested the Wald confidence interval based on inverting the binomial test.
We set out to compare the confidence interval of variance using the maximum likelihood method. e Bayesian approach depended on the available prior distribution, informative prior distribution, and noninformative prior distribution. e data are simulated from the normal distribution with varying true parameters and sample sizes.

Estimated Methods
e variance of the normal distribution is estimated by the maximum likelihood method and the Bayesian approach as the point estimation.
en, the confidence intervals are computed from the point estimation to construct the lower and upper bounds depending on the significance level. e central limit theorem is the main point in creating the confidence interval of the Bayesian approach.

Maximum Likelihood Method.
e maximum likelihood method is the most popular method to approximate a parameter on several distributions. e concept of the maximum likelihood method is to start from the likelihood function of a random variable X. Let X 1 , . . . , X n be independent and identically distributed (iid) random variables via normal distribution with parameter μ and σ 2 ; hence, the probability density function is written by And it is defined as X ∼ N(μ, σ 2 ).

2
International Journal of Mathematics and Mathematical Sciences e likelihood function has used the multiplication of probability function as follows: From (2), take ln on likelihood function following From (3), differential with respect to parameter σ 2 , We obtain the σ 2 � n i�1 (x i − μ) 2 /n , so this estimator is a biased estimator, but it is a sufficient and consistent estimator.
e performance estimator has supported this property such as unbiased estimator, minimum of variance, consistency, and sufficiency. is estimator is adjusted from the maximum likelihood estimator and defined the property as σ 2 Aj.ML � n i�1 (x i − μ) 2 /n − 1. We know that x is an unbiased estimator, and we get the unbiased estimator in terms of x following σ 2 Aj.ML by using the concept of Chisquared distribution at degree of freedom n − 1 [2] following ((n − 1)σ 2 Aj.ML /σ 2 ) ∼ χ 2 n−1 ; then it can be rewritten as Aj.ML e code for the maximum likelihood method in R programming language is as follows (the example of 90% confidence interval)

Bayesian Approach with Available Prior Distribution.
From the maximum likelihood method, we know that the probability density function of random variables is a normal distribution as X ∼ N(μ, σ 2 ) e estimation of the Bayesian approach is considered by adjusting the parameter of normal distribution by X ∼ N(μ, ϕ − 1 ), where ϕ − 1 � σ 2 and μ is a constant value; then, the probability distribution function from (1) can be rewritten by From (2), the likelihood function is changed parameter by e prior distribution of ϕ is considered in form of a gamma distribution with parameter α, λ denoted by Gamma(α, λ) or rewritten as e resulting posterior distribution is a gamma distribution that is implied by the conjugate distribution from normal distribution on (6) and gamma distribution on (8) as Recognizing that this result is displayed in the form of gamma distribution: where A � n/2 + α and B � λ + (1/2) n i�1 (x i − μ) 2 . μ is approximated by using x; then, it can be rewritten as [5]. With the parameterization, the posterior distribution of e inverse gamma distribution [20] is the same distribution as the reciprocal of a gamma distribution and the relationship of Y � 1/X, (X ∼ Gamma(α, λ)) is defined to the inverse gamma distribution as Y ∼ IG(α, λ). e inverse gamma distribution in the form of random variable Y is written as A similar way to estimate the variance of the Bayesian method is defined as and the variance of Bayesian estimator is calculated as International Journal of Mathematics and Mathematical Sciences 3 To evaluate our proposed method, the prior distribution of ϕ is proposed in the form of gamma distribution with parameters α and λ or denoted by Gamma(α, λ). en, the parameter of gamma distribution is an available prior distribution as the gamma, Chi-squared, and exponential distributions by Gamma(2, 1), Gamma(2, 0.5), and Gamma(1, 0.2), shown in Figure 1.
From central limit theorem [15] with n ⟶ ∞, it can approximate in the form of standard normal distribution by is is an asymptotic confidence interval that will only give an approximation as the large sample size, which has better coverage rates for small samples [21]. e definition of the confidence interval can be expressed as Putting these together, (14) and (15), it is often written as en, e confidence interval at (1 − α)100% of σ 2 is approximated by 2 . e code of R programming language for the Bayesian approach with available prior distribution is set as the constant values of prior distribution as follows (the example of 90% confidence interval).

Bayesian Approach with Informative Prior.
Evaluation of the suitable value on the prior distribution is an important problem because of the difficulty of estimating parameters via the posterior distribution. e solution problem of available prior information has been developed using a sampling algorithm, such as this Markov Chain Monte Carlo (MCMC) method or called the informative prior. is algorithm of the MCMC method is to draw a random sample from the posterior distribution without the conveniently estimated prior distribution. e process is employed by sampling parameters from the Markov Chain method for estimating parameters on prior distribution by the Gibbs sampling algorithm [10]. en, the posterior distribution uses a Markov Chain and Gibbs sampling to approximate parameters from the MCMC method. We carry out the rjags package, which provides an interface from R [22] to rjags library to generate a sequence of dependent samples from the posterior distribution. Sampling process from the MCMC method is as follows: (1) Draw X 1 , . . . , X n from the normal distribution with parameter mean μ and variance σ 2 . (2) e parameter μ is generated from the normal distribution and the σ 2 is generated from the inverse gamma distribution with parameters a and b.
(3) Set initial value a (t) 0 from an exponential distribution and b (t) 0 from the gamma distribution with constant values. For each chain, the first 2000 iterations were discarded, and the last 5000 iterations were used to obtain the posterior distribution of the parameter. us, the MCMC estimator is σ 2 MCMC � T t�1 σ 2(t) /T. e confidence interval is created by computing the mean and the variance from the MCMC process as According to the central limit theorem with n ⟶ ∞, we have and erefore, We say that the confidence interval at (1 − α)100% of σ 2 by MCMC at (1 − α)100% is (23) e "rjags" package in the software R is used to estimate the MCMC estimator and confidence interval following (the example of 90% confidence interval): > jagmod < −jags.model("model_normal.txt," data-= dataset, inits = inits,n.chains = 1, n.adapt = 2000) > update(jagmod, n.iter = 20, progress.bar = "text") > posterior = coda.samples(jagmod, c("mu," "sigma"),n.iter = 5000, progress.bar = "text," thin = 2) > post = as.data.frame(as.matrix(posterior)) > var.mcmc = (post$sigma)^2 > mcmc.est = mean(var.mcmc)  prior information, it will approximate the estimator on the posterior distribution. If we have no information on prior distribution, we call it a noninformative prior. Agresti and Coull [19] studied the approximation of the interval estimation of binomial proportions based on inverting the Wald large-sample normal test. en, we used the Wald confidence intervals to construct the confidence interval of variance. e Fisher information in a single observation is needed as From (4) and (24), the Fisher information is defined as e asymptotic Wald confidence interval based on the maximum likelihood estimator tends to the central limit theorem as and We infer that in large sample, n ⟶ ∞ e Wald confidence interval at e motivation of noninformative prior is that the fisher information indicates the amount of information by the observation about the parameter. e code for the Bayesian approach with noninformative prior based on Wald method in R programming language is as follows (the example of 90% confidence interval).

Simulation Study
e details of simulated data and the results are stated in this section. e random variable X is generated from a normal distribution with the R program by setting the true parameter as mean (μ) at 2 and variance (σ 2 ) at 2, 6, and 12 as shown in Figure 2.
e sample sizes (n) are studied at 10 and 30 for small sample sizes, 50 and 100 for moderate sample sizes, and 500 and 1000 for large sample sizes. e estimated confidence intervals are obtained from the maximum likelihood method and Bayesian approach at the confidence interval level 90%, 95%, and 99%. Suppose the estimated confidence intervals cover the true parameter or population variance (σ 2 ) as 2, 6, and 12. We will count the number and compute the proportion denoted by the coverage probability (CP). e coverage probability is compared with the fixed confidence interval that we define the significance level at 0.05 (Z0.05/2 � 1.96). If the fixed confidence interval range can cover the coverage probability, we will perform these methods and consider the minimum of the average width. e average width of a confidence interval is evaluated by computing the average of the difference values between the upper limit and lower limit. Hence, the coverage probability covers the range of the fixed confidence interval by computing In this case, we define P 0 � 0.9, 0.95, and 0.99 that followed the level of confidence interval 90%, 95%, and 99%. e range of the fixed confidence interval is shown in Table 1. e R program generates data and estimates confidence intervals at 10,000 replications in each situation. e estimating confidence intervals of variance by Maximum Likelihood (ML), Bayesian approach with available prior distribution (gamma, Chi-squared, and exponential distributions), informative prior distribution (MCMC method), and noninformative prior distribution (Wald confidence interval) in Tables 2-4. e first column shows the true variance parameter, and the second column demonstrates the several sample sizes. e coverage probability (CP) and average width (AW) are presented in the following twelve columns for these methods. e minimizing AW values illustrate the performance of these methods in the form of underline AW values. However, some AW values are shown blank because the coverage probability is not in the range of the fixed confidence interval from Table 1. By observing the CP and AW, the results appear as follows.
Simulation results in Table 2 show that the maximum likelihood (ML) method has a reasonable coverage probability for small sample sizes. Nevertheless, the Bayesian  approach with prior distribution in gamma, chi-squared, and exponential distributions presents the most minimum AW, especially with moderate sample sizes. For large sample sizes, the Wald confidence interval has a good performance. Furthermore, the AW is shown to decrease as sample sizes increase. e CP of all methods is represented in Figure 3. From Figure 3, the CP values of ML and Wald present the exact value of all variances for each sample size and play in the range of the fixed confidence interval. e CP of Wald tends to increase when sample sizes increase. However, the MCMC method decreases when sample sizes increase. All methods fall in the range following the increasing sample sizes. When the variance increases in Figure 4, the CP is shown the slightly different in large sample sizes.
In Table 3, the ML and Bayesian approach results with available prior distribution are similar to those in Table 2.
However, the ML method shows the minimum AW in large variance at n � 300. e trends of CP of all methods are presented in Figure 5.
In Figure 5, the CP values of the Bayesian approach of gamma, Chi-squared, exponential distributions, and Wald trend to increase when the sample sizes also increase. Furthermore, when the variance increases in Figure 6, there is no affectation on the CP.
From Table 4, it is shown that the AW of ML has the minimum at small and moderate sample sizes. When the sample sizes are larger, the Wald has a good performance. e CP of all methods is presented in Figure 7.

Application in Real Data
e real data are collected from the airborne particulate matter 2.5 (PM 2.5: mg/m 3 ) from the air monitoring quality station of Bansomdejchaopraya Rajabhat University, Bangkok, ailand, from April 1, 2019, to 2022. ese data were obtained from ailand's Pollution Control Department (https://www.aqmthai.com) and used 10-1000 records for computing the confidence interval of variance. e distributions of PM 2.5 were presented in Figure 9, which showed the right skewness for the large sample sizes. us, the Shapiro-Wilk test was used to test the normal distribution of such data. From the p-values, it was evident that the sample sizes (10, 50, and 100) confirmed normal distribution except for the large sample sizes (300, 500, and  ). Moreover, normal Q-Q plots were constructed to show the normal distributions from the six sample sizes (Figure 10), which verified that the small sample sizes followed the normal distribution. Table 5 reported the interval width of 90%, 95%, and 99% confidence interval for the airborne particulate matter 2.5 (PM 2.5: mg/m 3 ). e results show that the 10, 50, and 100 sample sizes of the maximum likelihood (ML) method had the shortest interval width, which corresponds with the simulation results. For the large sample sizes (500 and 1000), the Wald method attended the shortest interval width, similar to the simulation results. Furthermore, the MCMC method shows the shortest of 300 sample sizes. erefore, it is a good choice for constructing the confidence interval when the data set supports a nonnormal form.

Conclusion
In this research, we have concentrated on estimating the confidence interval of variance via normal distribution by using maximum likelihood and the Bayesian approach. e coverage probability and average width are the criteria for the efficient method. rough a simulation study, the maximum likelihood method performs a reasonable method in small sample sizes following the Chi-squared distribution that creates the confidence interval (see [14]). e Bayesian approach depends on the gamma, Chi-squared, and exponential prior distribution, making a suitable performance method in moderate sample sizes. e Wald confidence is a reasonable working method for the large sample sizes in all cases. In particular, the CP of the Wald interval is such low values for the small sample sizes, but the large sample sizes converge into the range. Surprisingly, the MCMC method is weak even though the estimator obtains from the sampling algorithm. However, approximate results benefit normal distribution because of the inherent evolution of exact distribution. Form real data, the airborne particulate matter 2.5 is collected to estimate the confidence interval. It is clear from the results that the maximum likelihood and Wald methods are the reasonable working methods in small and large sample sizes, same as the simulation data set.

Data Availability
e data used to support the findings of this study are available from the author on request.

Conflicts of Interest
e author declares that there are no conflicts of interest regarding the publication of this paper.