| Using time series to model and predict data is a very effective method.The Moving Average Model(abbreviated as MA model)is one of the three basic models in time series.Parameter estimation is a very important part of the time series modeling process.Therefore,this article introduces the Griddy-Gibbs sampling algorithm in Bayesian theory,and attempts to combine it with the MA model to improve model accuracy.This article conducts research on the MA model and Griddy-Gibbs sampling algorithm(1)Starting from the theory of conjugate priors,assuming that the sample sequence of the MA model follows a multivariate normal distribution,this paper presents the likelihood function of the MA model under this condition.Based on the theory of conjugate priors,it derives the posterior distribution of parameters under a normal-inverse gamma distribution and applies this posterior distribution to Griddy-Gibbs sampling algorithm.Using R software,simulation analysis is conducted for MA(1)and MA(2)models and compared with maximum likelihood estimation method.Building upon these simulation analyses,financial repayment days data are analyzed and fitted to demonstrate the effectiveness of this method.(2)Starting from Jeffreys’ non-informative prior theory and combining it with the maximum likelihood method to obtain an estimate of random error,an approximate likelihood function is obtained by substituting this value into the MA model.Secondly,based on Jeffreys’ non-informative prior distribution and Bayes formula,the joint posterior distribution of parameters in the MA model is derived,and then the marginal posterior distributions of each component are calculated using integration.At the same time,Griddy-Gibbs sampling algorithm uses grids for computation.When there is a large amount of data,software runtime can be excessively long.Therefore,logarithmic operations are introduced on top of the original Griddy-Gibbs algorithm and distance functions are used to filter posterior samples.The parameter marginal posterior distribution of the MA model is applied to improved Griddy-Gibbs sampling algorithm and simulated analysis for both MA(1)and MA(2)models are conducted using R software while comparing them with approximate Bayesian methods.Based on simulation analysis results,a model is established for oil price data to compare real values with fitted values before demonstrating feasibility and effectiveness through validation sets using this method. |