Complex matrix to real matrix

Use this forum to post questions about syntax problems or general programming issues. Questions on implementing a particular aspect of econometrics should go in "Econometrics Issues" below.
g_defi
Posts: 12
Joined: Fri Nov 19, 2010 8:42 am

Complex matrix to real matrix

Unread post by g_defi »

Dear Tom,

I am seeking the most convenient way to transform a complex matrix into a real matrix in a formula (frml)?
Can I use something like ewise instruction?

Best regards.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Complex matrix to real matrix

Unread post by TomDoan »

I'm not sure what you mean by "in a FRML". If you mean with something like an EWISE, yes:

dec rect r(n,n)
ewise r(i,j)=%real(c(i,j))
g_defi
Posts: 12
Joined: Fri Nov 19, 2010 8:42 am

Re: Complex matrix to real matrix

Unread post by g_defi »

Apologize if I was not clear.
I call the %logdensitycv function in a multivariate case. Since my estimator operates in frequency domain, I try to transform my transfer function (that is a complex matrix) into a real matrix:

Code: Select all

frml logl = %logdensitycv(transfer,periodogram,(float(n)/m))
where "transfer" and "periodogram" are symmetric complex matrix that I want to turn into real matrix.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Complex matrix to real matrix

Unread post by TomDoan »

The complex matrix equivalent of %LOGDENSITYCV would require arguments which are the spectral density implied by the model, the periodogram and the number of observations. The transfer function in this case would be a SERIES[CVECTOR] instead, and you would use that combined with the model spectral density in a complex equivalent of %LOGDENSITY. Which of the two do you have?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Complex matrix to real matrix

Unread post by TomDoan »

The attached function computes the log density of a complex Normal.
Attachments
cxlogdensity.src
Procedure/function file
(751 Bytes) Downloaded 1042 times
g_defi
Posts: 12
Joined: Fri Nov 19, 2010 8:42 am

Re: Complex matrix to real matrix

Unread post by g_defi »

Thanks for your reply.
Unfortunately I think I cannot use the complex log density of Normal because I perform a Whittle approximation of the Maximum Likelihood.
My problem is like trying to modify the FRACTINT.RPF file in order to estimate a bivariate VARFIMA(1,d,0).
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Complex matrix to real matrix

Unread post by TomDoan »

This extends %LOGDENSITYCV to complex matrices. That looks like what you want.
cxlogdensitycv.src
Procedure file
(842 Bytes) Downloaded 1103 times
g_defi
Posts: 12
Joined: Fri Nov 19, 2010 8:42 am

Re: Complex matrix to real matrix

Unread post by g_defi »

Yes it is. Thank you very much for your help!

Best regards.
Post Reply