Re: [R] Generate a matrix Q satisfying t(Q)%*%Q=Z and XQ=W

From: Stephane DRAY <>
Date: Thu 08 Jul 2004 - 04:32:51 EST

I want to create matrices for simulation purpose (in order to evaluate the efficiency of different methods on this simulated data set). So, I want to create a data matrix Q (m individuals and r variables). I want to specify the variance-covariance structure for this matrix (t(Q)%*%Q=Z ) but I want also to create another constraint due to another matrix of data. I want that the covariance of Q and X are equal to those given in W (XQ=W). The example I gave is just to illustrate my problem and perhaps it has no solution (I cannot see it because I have no idea how to construct Q such as Q=Q1=Q2)

At 00:00 07/07/2004, Spencer Graves wrote:
> Is a solution even possible for the matrices in your example?
>I've tried a few things that have suggested that a solution may not be
> What can you tell us of the problem that you've translated into
> this? I see a minimization problem subject to constraints, but I'm not
> certain which are the constraints and what is the objective function.
>For example, are you trying to find Q to minimize sum((Z-X'X)^2) subject
>to XQ=W or do you want to minimize sum((XQ-W)^2) subject to Q'Q=Z or
>something else?
> If it were my problem, I think I would work for a while with the
> singular value decompositions of X, W and Z, and see if that would lead
> me to more information about Q, including conditions under which a
> solution existed, expressions for Q when multiple solutions existed, and
> a solution minimizing your chosen objective function when solutions do
> not exist. (A google search produced many hits for "singular value
> decomposition", implemented as "svd" in R.)
> hope this helps. spencer graves
>Stephane DRAY wrote:
>>I have a question that is not directly related to R ... but I try to do
>>it in R ;-) :
>>I would like to generate a matrix Q satisfying (for a given Z, X and W)
>>the two following conditions:
>>t(Q)%*%Q=Z (1)
>>XQ=W (2)
>>Q is m rows and r columns
>>X is p rows and m columns
>>D is p rows and r columns
>>C is r rows and r columns
>>with m>p,r
>>#Create a matrix satisfying (1) is easy:
>>#For the second condition (2), a solution is given by
>>I do not know how to create a matrix Q that satisfies the two
>>conditions. I have try to construct an iterative procedure without
>>success (no convergence):
>>Perhaps someone could have any idea to solve the problem, or a reference
>>on this kind of question or the email of another list where I should ask
>>this question.
>>Thanks in advance,
>>Stéphane DRAY
>>Département des Sciences Biologiques
>>Université de Montréal, C.P. 6128, succursale centre-ville
>>Montréal, Québec H3C 3J7, Canada
>>Tel : 514 343 6111 poste 1233
>>E-mail :
>> mailing list
>>PLEASE do read the posting guide!

Stéphane DRAY

Département des Sciences Biologiques
Université de Montréal, C.P. 6128, succursale centre-ville Montréal, Québec H3C 3J7, Canada

Tel : 514 343 6111 poste 1233
E-mail :


______________________________________________ mailing list PLEASE do read the posting guide! Received on Thu Jul 08 04:35:34 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 02:34:53 EST