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.

Complex matrix to real matrix

Postby g_defi » Sun Apr 15, 2012 4:43 am

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.
g_defi
 
Posts: 13
Joined: Fri Nov 19, 2010 9:42 am

Re: Complex matrix to real matrix

Postby TomDoan » Mon Apr 16, 2012 12:21 pm

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))
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: Complex matrix to real matrix

Postby g_defi » Tue Apr 17, 2012 9:42 am

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.
g_defi
 
Posts: 13
Joined: Fri Nov 19, 2010 9:42 am

Re: Complex matrix to real matrix

Postby TomDoan » Tue Apr 17, 2012 1:28 pm

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: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: Complex matrix to real matrix

Postby TomDoan » Tue Apr 17, 2012 5:18 pm

The attached function computes the log density of a complex Normal.
Attachments
cxlogdensity.src
Procedure/function file
(751 Bytes) Downloaded 43 times
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: Complex matrix to real matrix

Postby g_defi » Wed Apr 18, 2012 4:19 am

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).
g_defi
 
Posts: 13
Joined: Fri Nov 19, 2010 9:42 am

Re: Complex matrix to real matrix

Postby TomDoan » Thu Apr 19, 2012 1:16 pm

This extends %LOGDENSITYCV to complex matrices. That looks like what you want.

cxlogdensitycv.src
Procedure file
(842 Bytes) Downloaded 41 times
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: Complex matrix to real matrix

Postby g_defi » Thu Apr 19, 2012 2:56 pm

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

Best regards.
g_defi
 
Posts: 13
Joined: Fri Nov 19, 2010 9:42 am


Return to Help With Programming

Who is online

Users browsing this forum: No registered users and 0 guests