想請教有沒有高手能解決splus用於MS_GARCH模式的預測及參數估計,
我目前找到有關的程式,只提供到ms_ar的部分,我想要將ms_ar的預測及估計式改成ms_garch的預測估計式,
想請問是否有人能幫忙將ms_ar的程式改成ms_garch的參數估計及預測。
附上我目前找到的ms_ar的程式,請好心幫助我~~謝謝.
######MS-AR(2)的函數
GetSsfMSAR = function(parm)
{
mDelta = mDelta.other = rep(0, 3)
mDelta[1] = parm[1]
mDelta.other[1] = parm[2]
#
mPhi = mPhi.other = matrix(0, 3, 2)
mPhi[1,] = c(parm[3], parm[4])
mPhi.other[1,] = c(parm[5], parm[6])
mPhi[2:3,1] = mPhi.other[2:3,1] = 1
#
mOmega = mOmega.other = matrix(0, 3, 3)
mOmega[1,1] = parm[7]
mOmega.other[1,1] = parm[8]
#
mSigma = matrix(0, 3, 2)
mSigma[1:2, 1:2] = diag(1e+6, 2)
#
mTrans = matrix(0, 2, 2)
mTrans[1,1] = parm[9]
mTrans[1,2] = 1 - mTrans[1,1]
mTrans[2,2] = parm[10]
mTrans[2,1] = 1 - mTrans[2,2]
#
list(mDelta=mDelta, mDelta.other=mDelta.other,
mPhi=mPhi, mPhi.other=mPhi.other,
mOmega=mOmega, mOmega.other=mOmega.other,
mSigma=mSigma, mTrans=mTrans)
}