与给定矢量形成正交基的矩阵 [英] matrix that forms an orthogonal basis with a given vector

查看:172
本文介绍了与给定矢量形成正交基的矩阵的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个线性代数问题;

给定一个k-变量赋范向量u(即u:|| u || _2 = 1)
怎么做你构造单位向量的任意任意k *(k-1)
矩阵,使得(u,\\ gamma_u)形成
正交基??

我的意思是:从计算机立场的角度来看:
你用什么算法来构造这样的矩阵?



预先感谢, 解决方案

应用u_0的Gram Schmidt正交化和k-1随机生成的向量。如果在某一时刻GS算法产生一个零向量,那么你有一个线性依赖关系,在这种情况下,再次随机选择向量。然而,这种方法是不稳定的,数值很小矢量表示中的错误被放大。然而,这个算法存在一个稳定的修改:

a_1 = u,a_2,... a_k 是随机选择的向量

  for i = 1 to k do 
vi = ai
end for

for i = 1 to k do
rii = | vi |
qi = vi / rii
for j = i + 1 to k do
rij =< qi,vj>
vj = vj -rij * qi
end for
end for

结果向量 v1,... vk 将成为矩阵的列,其中 v1 = u 。如果某点 vj 变为零,则选择一个新的矢量 aj 并重新开始。请注意,如果向量a2,..,ak是随机选择的,则发生这种情况的概率可以忽略不计。


A linear algebra question;

Given a k-variate normed vector u (i.e. u : ||u||_2=1) how do you construct \Gamma_u, any arbitrary k*(k-1) matrix of unit vectors such that (u,\Gamma_u) forms an orthogonal basis ?

I mean: from a computationnal stand point of view: what algorithm do you use to construct such matrices ?

Thanks in advance,

解决方案

The naive approach would be to apply Gram Schmidt orthogonalisation of u_0, and k-1 randomly generated vectors. If at some point the GS algorithm generates a zero vector, then you have a linear dependency in which case choose the vector randomly again.

However this method is unstable, small numerical errors in the representation of the vectors gets magnified. However there exists a stable modification of this algorithm:

Let a_1 = u, a_2,...a_k be randomly chosen vectors

for i = 1 to k do 
        vi = ai
end for 

for i = 1 to k do
    rii = |vi| 
    qi = vi/rii
    for j = i + 1 to k do
       rij =<qi,vj>
       vj =vj −rij*qi 
    end for
end for

The resulting vectors v1,...vk will be the columns of your matrix, with v1 = u. If at some point vj becomes zero choose a new vector aj and start again. Note that the probability of this happening is negligible if the vectors a2,..,ak are chosen randomly.

这篇关于与给定矢量形成正交基的矩阵的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆