Bob,

 mSigma = mD%*%mR%*%mD, which is similar to the DCC model

See below for my likelihood function:

 for(t in 1:10)
{
mQ = matrix(mDupl%*%(vB + mSq%*%vFactors),iK)
mDelta = sqrt(diag(diag(mQ)))
 mInvDelta = solve(mDelta)

mWdelta = Wdelta(mDelta)
 mR = mInvDelta%*%mQ%*%mInvDelta
 #if(iVarParam=='M_VAR')
 ## f_t parameterized as variances
mD = vec2diag(sqrt( mSd%*%vFactors));
                        #mD=diag(iK)
                        #print(mSd);
                        #print(vFactors);
                        #print(mD);
mWd = Wd(mD);

mPsi = mElim%*%((mD%*%mR)%x%diag(iK) + diag(iK)%x%(mD%*%mR))%*%mWd%*%mSd;
  ## add the matrix of derivatives for the correlations to the matrix of
derivatives for the variance
mInvDelta = mInvDelta%x%mInvDelta;
mPsi = mPsi + mElim%*%(mD%x%mD)%*%mInvDelta%*%(mDupl - ((mDelta%x%mQ) +
(mQ%x%mDelta))%*%mInvDelta%*%mWdelta%*%mSdelta)%*%mSq;
      mSigma = mD%*%mR%*%mD;
mInvSigma =solve(mSigma);

      mSigmaKron = mInvSigma%x%mInvSigma;
## compute the weight
dw = ((nu+iK)/((nu-2)*(1 + (t(mY[t,])%*%mInvSigma%*%mY[t,])/(nu-2))));
 temp = t(mPsi)%*%t(mDupl);
vScore =
0.5*temp%*%t(mSigmaKron)%*%(as.numeric(dw)*(mY[t,]%x%mY[t,])-c(mSigma));
 mJ = chol(mInvSigma);
 mJ = mJ%x%mJ;
 temp = temp%*%mJ;
mInfo = (1/4)*temp%*%mG%*%t(temp);
 mInvInfo = ginv(mInfo);
 pdLoglike=pdLoglike+log(gamma((nu+iK)/2))-log(gamma(nu/2))-(iK/2)*log(nu-2)-(iK/2)*log(pi)
-0.5*log(abs(det(mSigma)))-((nu + iK)/2) * log(1 +
t(mY[t,])%*%mInvSigma%*%mY[t,]/(nu-2))
 vFactors = vOmega2 + mA %*% mInvInfo %*% vScore + mB %*% vFactors;

a=c(pdLoglike)
}




On Sun, Mar 9, 2014 at 1:16 PM, Robert A Yaffee <bob.yaffee@nyu.edu> wrote:

> Jun,
>   mSigma could also be your starting value matrix, where P is stacked over
> the state vector.
>    Are you  using a diffuse prior for variance matrix?
>     - Bob
>
>
>
>
> On Sun, Mar 9, 2014 at 1:14 PM, Robert A Yaffee <bob.yaffee@nyu.edu>wrote:
>
>> Jun,
>>    mSigma is the error covariance matrix.   Can you use different data
>> that
>> is not so collinear?
>>    -  Bob
>>
>>
>>
>> On Sun, Mar 9, 2014 at 1:07 PM, jun wang <junluke@gmail.com> wrote:
>>
>>> OK, I am trying to implement the two dimension GAS model in R of this
>>> paper:
>>>
>>> *A Dynamic Multivariate Heavy-Tailed Model for Time-Varying Volatilities
>>> and Correlations*
>>> , but the 'optim' function in R always give me a error message:
>>>
>>> Error in solve.default(mSigma) :
>>>   system is computationally singular: reciprocal condition number =
>>> 2.97425e-20
>>>
>>> Don't know where i made a mistake
>>>
>>>
>>> On Sun, Mar 9, 2014 at 12:57 PM, Robert A Yaffee <bob.yaffee@nyu.edu>wrote:
>>>
>>>> Jun,
>>>>    No.  They are univariate GAS, EGAS, and AEGAS models.
>>>>      -   Bob
>>>>
>>>>
>>>>
>>>> On Sun, Mar 9, 2014 at 9:43 AM, Gmail <junluke@gmail.com> wrote:
>>>>
>>>>> Bob,
>>>>>
>>>>> Is that a univariate version? I am interested on the multivariate gas
>>>>> model.
>>>>>
>>>>> Thanks,
>>>>> Jun
>>>>>
>>>>> Sent from my iPad
>>>>>
>>>>> On Mar 9, 2014, at 3:08 AM, Robert A Yaffee <bob.yaffee@nyu.edu>
>>>>> wrote:
>>>>>
>>>>> Jun,
>>>>>   You may want to look for the model under the rubric of dynamic
>>>>> conditional score model (a.k.a. Dysco),
>>>>>   which is the version of it that Andrew Harvey and Tirthankar
>>>>> Chakravarti developed.
>>>>>         Cheers,
>>>>>      Bob Yaffee
>>>>>
>>>>>
>>>>> On Sun, Mar 9, 2014 at 3:00 AM, Robert A Yaffee <bob.yaffee@nyu.edu>wrote:
>>>>>
>>>>>> Jun,
>>>>>>    The model is available in the OxMetrics version 7's G@RCH module.
>>>>>>  I haven't seen it in R yet.
>>>>>>       -  Bob Yaffee
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Sat, Mar 8, 2014 at 11:25 PM, jun wang <junluke@gmail.com> wrote:
>>>>>>
>>>>>>> Dear all,
>>>>>>>
>>>>>>> Any of you have implemented Koopman's GAS model in R? I am writing
>>>>>>> code in
>>>>>>> R trying to replicate the results of this paper:
>>>>>>> *A Dynamic Multivariate Heavy-Tailed Model for Time-Varying
>>>>>>> Volatilities
>>>>>>> and Correlations*
>>>>>>> I am having a hard time to get my code work. Any advice would be very
>>>>>>> appreciated.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Jun
>>>>>>>
>>>>>>>         [[alternative HTML version deleted]]
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> R-SIG-Finance@r-project.org mailing list
>>>>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>>>>>>> -- Subscriber-posting only. If you want to post, subscribe first.
>>>>>>> -- Also note that this is not the r-help list where general R
>>>>>>> questions should go.
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Bob Yaffee
>>>>>>
>>>>>> Biosketch: http://homepages.nyu.edu/~ray1/Biosketch2009.pdf
>>>>>>
>>>>>> CV:  http://homepages.nyu.edu/~ray1/vita.pdf
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Bob Yaffee
>>>>>
>>>>> Biosketch: http://homepages.nyu.edu/~ray1/Biosketch2009.pdf
>>>>>
>>>>> CV:  http://homepages.nyu.edu/~ray1/vita.pdf
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Bob Yaffee
>>>>
>>>> Biosketch: http://homepages.nyu.edu/~ray1/Biosketch2009.pdf
>>>>
>>>> CV:  http://homepages.nyu.edu/~ray1/vita.pdf
>>>>
>>>
>>>
>>
>>
>> --
>> Bob Yaffee
>>
>> Biosketch: http://homepages.nyu.edu/~ray1/Biosketch2009.pdf
>>
>> CV:  http://homepages.nyu.edu/~ray1/vita.pdf
>>
>
>
>
> --
> Bob Yaffee
>
> Biosketch: http://homepages.nyu.edu/~ray1/Biosketch2009.pdf
>
> CV:  http://homepages.nyu.edu/~ray1/vita.pdf
>

	[[alternative HTML version deleted]]

