[R] GSVD and qr questions
Roy Mendelssohn - NOAA Federal
roy.mendelssohn at noaa.gov
Tue May 5 06:14:38 CEST 2015
Thanks. But to be honest I am outside of what I really know. so I don’t know if what you describe is what I want I know what the Matlab function I have calls and what it does, and I am trying to mimic its functionality. So I am trying to see if there is equivalent to the Matlab qr(A,0) call, that way I know I am getting the same result.
-Roy M.
> On May 4, 2015, at 9:10 PM, Richard M. Heiberger <rmh at temple.edu> wrote:
>
> Roy,
>
> Look at the qr.R and qr.Q functions. With the complete=TRUE argument
> they bring their matrices up to full size,
> by constructing an arbitrary orthogonal completion.
> Does this provide what you are looking for?
>
> Rich
>
> On Mon, May 4, 2015 at 11:56 PM, Roy Mendelssohn - NOAA Federal
> <roy.mendelssohn at noaa.gov> wrote:
>> Hi All:
>>
>> I posted some of this earlier to the r-sig-mac because at that time I got a Mac specific error, but now I have a more general question. For a canonical variate analysis (CVA) used in some system identification routines, I need to calculate a generalized svd (GSVD). On the web there are several scripts that are suppose to work with the LAPACK implementation of GSVD, but when I try them with my matrices I get an index error. I can save the two arrays using R.matlab and read the matrices into Matlab, and the GSVD function in Matlab works fine for the same arrays. I get the same error trying to use the GSVD routine in the PEIP package in R.
>>
>> I have found a Matlab routine that calculates the GSVD using only QR, CHOL and SVD calls, but some of this is outside of what I know and I am trying to translate the routine to R. I have two questions:
>>
>> 1. Does anyone know of a working routine for GSVD in R (and I looked in ‘sos’ that is how I found the one in PEIP)?
>>
>> 2. In the Matlab function I am trying to translate, they call for the QR decomposition of the matrix A as qr(A,0). The second argument (0) according to Matlab does the economy QR decomposition:
>>
>>> qr(A,0) produces the economy-size decomposition. If m > n, only the first n columns of Q and the first n rows of R are computed. If m<=n, this is the same as [Q,R] = qr(A).
>>
>> Reading over the help for the”qr” function in R it is unclear that there is a similar way to do an “economy” decomposition with one of the optional arguments. I am probably being brain-dead, but I don’t see how to do that in the R function.
>>
>> Thanks for any help.
>>
>> -Roy M.
>>
>> **********************
>> "The contents of this message do not reflect any position of the U.S. Government or NOAA."
>> **********************
>> Roy Mendelssohn
>> Supervisory Operations Research Analyst
>> NOAA/NMFS
>> Environmental Research Division
>> Southwest Fisheries Science Center
>> ***Note new address and phone***
>> 110 Shaffer Road
>> Santa Cruz, CA 95060
>> Phone: (831)-420-3666
>> Fax: (831) 420-3980
>> e-mail: Roy.Mendelssohn at noaa.gov www: http://www.pfeg.noaa.gov/
>>
>> "Old age and treachery will overcome youth and skill."
>> "From those who have been given much, much will be expected"
>> "the arc of the moral universe is long, but it bends toward justice" -MLK Jr.
>>
>> ______________________________________________
>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
**********************
"The contents of this message do not reflect any position of the U.S. Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new address and phone***
110 Shaffer Road
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: Roy.Mendelssohn at noaa.gov www: http://www.pfeg.noaa.gov/
"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected"
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.
More information about the R-help
mailing list