- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
使用因子分析最重要的问题之一是它的解释。因子分析通常使用因子旋转来增强其解释。经过满意的旋转后,旋转后的因子加载矩阵L'将具有相同的表示相关矩阵的能力,可以作为因子加载矩阵,代替未旋转的矩阵L.
旋转的目的是使旋转后的因子加载矩阵具有一些理想的性质。使用的方法之一是旋转因子加载矩阵,使旋转后的矩阵具有简单结构。
大号。 L. Thurstone 介绍了简单结构原则,作为因子轮换的一般指南:
理想的简单结构是这样的:
问题是,尝试几种旋转方法的组合以及每种方法接受的参数(尤其是倾斜的),候选矩阵的数量会增加,很难看出哪一种更符合上述标准。
当我第一次遇到这个问题时,我意识到我无法仅通过“查看”它们来选择最佳匹配,我需要一种算法来帮助我做出决定。在项目截止日期的压力下,我最多只能在 MATLAB 中编写以下代码,它一次接受一个旋转矩阵并返回(在某些假设下)是否满足每个标准。新版本(如果我曾尝试升级它)将接受 3d 矩阵(一组 2d 矩阵)作为参数,算法应返回更符合上述标准的那个。
我只是征求您的意见(我还认为有人批评该方法本身的实用性)以及可能是解决旋转矩阵选择问题的更好方法。如果有人想提供一些代码,我更喜欢 R 或 MATLAB。
附言以上Simple Structure Criteria formulation可以在 PETT, M., LACKEY, N., SULLIVAN, J 所著的"Making Sense of Factor Analysis"一书中找到。
P.S.2(来自同一本书):“成功的因素分析的测试是它可以在多大程度上重现原始的corr矩阵。如果你也使用了斜解,在所有的选择中选择生成最高和最低因子载荷的最大数量。”这听起来像是算法可以使用的另一个约束。
function [] = simple_structure_criteria (my_pattern_table)
%Simple Structure Criteria
%Making Sense of Factor Analysis, page 132
disp(' ');
disp('Simple Structure Criteria (Thurstone):');
disp('1. Each row of the factor matrix should contain at least one zero');
disp( '2. If there are m common factors, each column of the factor matrix should have at least m zeros');
disp( '3. For every pair of columns in the factor matrix, there should be several variables for which entries approach zero in the one column but not in the other');
disp( '4. For every pair of columns in the factor matrix, a large proportion of the variables should have entries approaching zero in both columns when there are four or more factors');
disp( '5. For every pair of columns in the factor matrix, there should be only a small number of variables with nonzero entries in both columns');
disp(' ');
disp( '(additional by Pedhazur and Schmelkin) The ideal simple structure is such that:');
disp( '6. Each item has a high, or meaningful, loading on one factor only and');
disp( '7. Each factor have high, or meaningful, loadings for only some of the items.');
disp('')
disp('Start checking...')
%test matrix
%ct=[76,78,16,7;19,29,10,13;2,6,7,8];
%test it by giving: simple_structure_criteria (ct)
ct=abs(my_pattern_table);
items=size(ct,1);
factors=size(ct,2);
my_zero = 0.1;
approach_zero = 0.2;
several = floor(items / 3);
small_number = ceil(items / 4);
large_proportion = 0.30;
meaningful = 0.4;
some_bottom = 2;
some_top = floor(items / 2);
% CRITERION 1
disp(' ');
disp('CRITERION 1');
for i = 1 : 1 : items
count = 0;
for j = 1 : 1 : factors
if (ct(i,j) < my_zero)
count = count + 1;
break
end
end
if (count == 0)
disp(['Criterion 1 is NOT MET for item ' num2str(i)])
end
end
% CRITERION 2
disp(' ');
disp('CRITERION 2');
for j = 1 : 1 : factors
m=0;
for i = 1 : 1 : items
if (ct(i,j) < my_zero)
m = m + 1;
end
end
if (m < factors)
disp(['Criterion 2 is NOT MET for factor ' num2str(j) '. m = ' num2str(m)]);
end
end
% CRITERION 3
disp(' ');
disp('CRITERION 3');
for c1 = 1 : 1 : factors - 1
for c2 = c1 + 1 : 1 : factors
test_several = 0;
for i = 1 : 1 : items
if ( (ct(i,c1)>my_zero && ct(i,c2)<my_zero) || (ct(i,c1)<my_zero && ct(i,c2)>my_zero) ) % approach zero in one but not in the other
test_several = test_several + 1;
end
end
disp(['several = ' num2str(test_several) ' for factors ' num2str(c1) ' and ' num2str(c2)]);
if (test_several < several)
disp(['Criterion 3 is NOT MET for factors ' num2str(c1) ' and ' num2str(c2)]);
end
end
end
% CRITERION 4
disp(' ');
disp('CRITERION 4');
if (factors > 3)
for c1 = 1 : 1 : factors - 1
for c2 = c1 + 1 : 1 : factors
test_several = 0;
for i = 1 : 1 : items
if (ct(i,c1)<approach_zero && ct(i,c2)<approach_zero) % approach zero in both
test_several = test_several + 1;
end
end
disp(['large proportion = ' num2str((test_several / items)*100) '% for factors ' num2str(c1) ' and ' num2str(c2)]);
if ((test_several / items) < large_proportion)
pr = sprintf('%4.2g', (test_several / items) * 100 );
disp(['Criterion 4 is NOT MET for factors ' num2str(c1) ' and ' num2str(c2) '. Proportion is ' pr '%']);
end
end
end
end
% CRITERION 5
disp(' ');
disp('CRITERION 5');
for c1 = 1 : 1 : factors - 1
for c2 = c1 + 1 : 1 : factors
test_number = 0;
for i = 1 : 1 : items
if (ct(i,c1)>approach_zero && ct(i,c2)>approach_zero) % approach zero in both
test_number = test_number + 1;
end
end
disp(['small number = ' num2str(test_number) ' for factors ' num2str(c1) ' and ' num2str(c2)]);
if (test_number > small_number)
disp(['Criterion 5 is NOT MET for factors ' num2str(c1) ' and ' num2str(c2)]);
end
end
end
% CRITERION 6
disp(' ');
disp('CRITERION 6');
for i = 1 : 1 : items
count = 0;
for j = 1 : 1 : factors
if (ct(i,j) > meaningful)
count = count + 1;
end
end
if (count == 0 || count > 1)
disp(['Criterion 6 is NOT MET for item ' num2str(i)])
end
end
% CRITERION 7
disp(' ');
disp('CRITERION 7');
for j = 1 : 1 : factors
m=0;
for i = 1 : 1 : items
if (ct(i,j) > meaningful)
m = m + 1;
end
end
disp(['some items = ' num2str(m) ' for factor ' num2str(j)]);
if (m < some_bottom || m > some_top)
disp(['Criterion 7 is NOT MET for factor ' num2str(j)]);
end
end
disp('')
disp('Checking completed.')
return
最佳答案
我知道这不是你要问的,但即使在其他情况下你也可能会发现这很有用:
MATLAB 应仅在确实不可避免时才使用循环。例如,您的代码
%// CRITERION 6
disp(' ');
disp('CRITERION 6');
for i = 1 : 1 : items
count = 0;
for j = 1 : 1 : factors
if (ct(i,j) > meaningful)
count = count + 1;
end
end
if (count == 0 || count > 1)
disp(['Criterion 6 is NOT MET for item ' num2str(i)])
end
end
应该写成
%// CRITERION 6
disp(' ');
disp('CRITERION 6');
ct_lg_meaningful = sum(ct > meaningful,2) %// check where ct>meaningful, and sum along 2nd axis - gives a column vector of number of times each row was larger than meaningful.
criteria_not_met = find((ct_lg_meaningful == 0)|(ct_lg_meaningful>1)) %// in this vector find elements that are 0 or >1
if length(criteria_not_met)>0 %// if we found any elements, display them.
disp(['Criterion 6 is NOT MET for items ' num2str(criteria_not_met')]) %' <- to fix SO syntax highlighting
end
关于algorithm - FA : Choosing Rotation matrix, 基于 "Simple Structure Criteria",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2139703/
我想创建一个对象,比方说一个饼图。 class Pie def initialize(name, flavor) @name = name @flavor = flavor e
我正在寻找类似于 Log property in Linq DataContext 的功能. 最佳答案 所有执行的 SQL 都写入 Trace,因此您可以使用 TraceListener 访问。 关于
使用 django-simple-history ,如何从我的模型中获取最后更改的对象? 我尝试了 MyModel.history.most_recent(),它需要一个模型实例,因此可能会返回所选实
我定期使用 Eclipse 调试器,这一直困扰着我关于 IDE 的问题。步进过滤是一个非常宝贵的工具,这样我就不会进入没有源代码或者我根本不感兴趣的类。但是,Eclipse 在大多数情况下都没有正确处
我基于有向图构建一棵树。源数据是 SQL 表中的一系列父子关系。它肯定是一棵树(无论如何我都会验证)。我想要一组从根到每片叶子的简单路径。数据是会计“科目表”中的标题,路径类似于“根 -> Asset
我对如何在torii中使用ember-simple-auth有点困惑 我正在使用ember-cli-simple-auth和ember-cli-simple-auth-torii 我得到下面提到的错误
考虑以下用 simple-xml 注释注释的枚举: @Root(name="days") public enum DaysOfWeek { SUNDAY("blue", 30), MO
我有一个 json 文件,我正在 excel 中创建一些 vba 代码。我想用java读取这个json文件。为此,我编写了以下代码 try { Class.forName("org.j
我在尝试使用 google 的 simple-json 解析一个简单的 json 时遇到了一个奇怪的问题。 这是我的代码,它不起作用: String s = args[0].toString(); J
我正在尝试解析下面的 json 文件: {"units":[{"id":42, "title":"Hello World", "positi
我正在使用 simple-import-sort eslint 插件进行 react 。我想我的 .eslintrc.js是对的,但我无法使这个特定的插件工作。我在文件的第一行收到以下错误: 未找到规
我正在尝试解析子文件,但我不知道自己做错了什么(当然,我也不知道自己做对了什么)。 文件.json [{ "arrOne":{ "one":"a", "two":"b",
在我的Angel 16(独立的)应用程序中,我有一个简单的服务来测试LangChain和OpenAI。同样的代码在NodeJS应用程序中运行得非常好,然而,当从角度运行时,OpenAI返回的结果总是空
我正在尝试测试连接到数据库的 Web 应用程序 - 我的 Junit 代码不执行连接。 设置按照 https://github.com/h-thurow/Simple-JNDI InitialCont
我正在尝试制作一个小型应用程序,它可以通过 ISBN 在亚马逊上搜索一本书。我是 Amazon Web Service 的新手。 我正在关注以下链接: http://flyingpies.wordpr
我正在使用简单 XML 序列化 (simple-xml-2.6.6.jar) here将我的 XML 响应从 webservice 转换为 POJO 类。 XML 是:
Simple UI混合开发的必经之路~ Simple UI快速上手 在混合开发的模式下,如果想使用django admin,又嫌弃后台不符合你的审美?Simple UI给你想要的答案,我不是打广告的~
Simple JSON是Google开发的Java JSON解析框架,基于Apache协议。 下载的文件是:json_simple.jar 例子1:很方便的方式,使用JSONValue
我有一个 simple_form 表单设置,它会很好地显示内联错误。我遇到过一些用户看不到这些错误的问题,并要求在非常长的表格顶部进行清晰的枚举。我使用了 Rails 教程中的代码设置:
我正在使用简单的 XML 框架,只是重命名了一些 XML 布局,这些布局现在似乎不再起作用了。 这是我的 XML: 2 0 1
我是一名优秀的程序员,十分优秀!