Using orthogonal matrix to design test spec--2

  Today,I will go on talking the detail for it.First and foremost,I think I should illustrate that in what circumstances can we use orthogonal array testing strategy to design test spec.Except for confirming factors and levels,we also should make sure the interaction between each factor.In other words,they should have some conditionality.We can use strength to describe this relationship.Take an example,if there are three factor--A,B,C.If we consider the strenth is two,we should think the relationship between A and B,A and C,B and C respectively.In the same principle,we think the relationship among A,B,and C,as strenth is 3.So if there is no relationship between factors and there are only two factors,I think use this method is no meaning.After settle this issue,we can begin to discussing how to design test spec using this method.

  At first,we should know how many factors are they have.It determine how many column the table will have.Second,we should understand how many levels of each factor.There have a conception we should know.How to make sure levels?What is norm?The levels is not how many values we can input in fact.(This concept has something wrong in my forer article)It should determine base on the principle of divisiory equivalent.For instance,if we have a textbox which can input 11 characters.The levles we can find like these,12 chracters,11 characters or 0 characters.In other words,we won't input several reasonable values to test if it is correct.We divide the value to two scopes--reasonable and unresonable.In reaonable scope,we can input any correct value to test.Meanwhile,we can input only one incorrect value to test if it can judge.That's the reason you see in some resourse,they only test two instance--fill a value or not.After that,we can start our third step--choose orthogonal table--base on our factors and levels.The table should consistent with this two values.Then we can find some tables online,certainly,if levels is special,you can design it by yourself.For example,maybe one factor have two levles,other two factors have three levels or more.In this case,we need design it by ourself.For now,it can said we have finished a basically table.Furthermore,sometime,if a factor has odd levels,we can take this level of factor alternate in the table from the top to bottom. At last,determine how many runs it has?This is base on your mind.We also can add some rows to cover some uncertain instances.These are all up on different circs.

  Ok,here,we can said a comletely orthogonal table is finished.But,I believe the core of it need farther understanding.I won't take an instance in here,however,I can put a link,it will more helpful.And I also thanks the author who give me lots of suggestions on this question.His blog is very good.Thanks a lot!The link is http://blog.csdn.net/zeeslo/archive/2006/09/26/1289991.aspx

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
SVD(奇异值分解)是一种重要的矩阵分解方法,可以将一个矩阵分解为三个矩阵的乘积:$A = U\Sigma V^T$。其中,$A$是$m\times n$的矩阵,$U$是$m\times m$的正交矩阵,$\Sigma$是$m\times n$的对角矩阵,且对角线上的元素按照降序排列,$V$是$n\times n$的正交矩阵。SVD的应用非常广泛,包括数据压缩、信号处理、图像处理等领域。 本文将介绍使用双边Jacobi方法(Double-Sided Jacobi Method)来计算SVD的Matlab代码,并通过一个实例来说明其用法。 双边Jacobi方法是一种迭代算法,每一次迭代都会旋转两个正交矩阵,直到达到某个停止条件为止。该算法的优点是能够同时计算出$U$和$V$,且不需要显式地计算$A^TA$和$AA^T$,因此适用于大规模稠密矩阵的SVD计算。 下面是使用双边Jacobi方法计算SVD的Matlab代码: ```matlab function [U,S,V] = svd_jacobi(A) % SVD using double-sided Jacobi method % A: m x n matrix % U: m x m orthogonal matrix % S: m x n diagonal matrix with singular values in decreasing order % V: n x n orthogonal matrix [m,n] = size(A); if m < n % SVD of A' is computed instead [U,S,V] = svd_jacobi(A'); V = U'; U = V'; return; end U = eye(m); V = eye(n); S = A; tol = 1e-10; % tolerance for convergence max_iter = 1000; % maximum number of iterations iter = 0; while max(max(abs(triu(S,1)))) > tol && iter < max_iter [p,q] = find(abs(triu(S,1)) == max(max(abs(triu(S,1))))); % indices of largest off-diagonal element p = p(1); q = q(1); theta = atan2(2*S(p,q),S(q,q)-S(p,p))/2; J = eye(m); J(p,p) = cos(theta); J(q,q) = cos(theta); J(p,q) = sin(theta); J(q,p) = -sin(theta); U = U*J'; S = J*S*J'; J = eye(n); J(p,p) = cos(theta); J(q,q) = cos(theta); J(p,q) = sin(theta); J(q,p) = -sin(theta); V = V*J'; iter = iter + 1; end S = diag(diag(S)); ``` 该代码的基本思路是:将输入矩阵$A$初始化为$S$,并将$U$和$V$初始化为单位矩阵。然后,每次迭代都会找到$S$中最大的非对角元素,并将其对应的行和列进行旋转,使其变成对角矩阵。同时,$U$和$V$也进行相应的旋转,以保持正交性。当$S$的非对角元素的最大值小于某个阈值或者迭代次数超过某个上限时,算法停止。 下面是一个例子,演示如何使用该代码来计算SVD: ```matlab % generate a random matrix A = randn(5,3); % compute SVD using built-in function [U1,S1,V1] = svd(A); % compute SVD using Jacobi method [U2,S2,V2] = svd_jacobi(A); % compare the results disp('U1 - U2:'); disp(norm(U1-U2)); disp('S1 - S2:'); disp(norm(S1-S2)); disp('V1 - V2:'); disp(norm(V1-V2)); ``` 该例子中,首先生成一个$5\times 3$的随机矩阵$A$,然后分别使用Matlab内置函数`svd`和双边Jacobi方法计算SVD。最后,通过计算两种方法得到的$U$、$S$和$V$之间的欧几里德距离,来比较它们的差异。 希望本文可以帮助你理解SVD和双边Jacobi方法的基本思路,并能够使用Matlab代码进行计算。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值