感谢您打开此消息!
我试图将网络累积分布的对数 - 对数图拟合为三种模型之一:指数(EXP)(P(k)~e ^( - ak)),指数截断幂律(TRU) )(P(k)~k ^(a-1)e ^(k / kc))和幂律(POWER)(P(k)~k ^ -a)。我知道这是一个低信息测试,但我只想确定哪三个模型最合适(或者可能最不合适!)
我意识到TRU有2个自由度,而EXP和POWER只有1个自由度。
我在R中有以下数据:
logCPK<-c(0, -0.0014, -0.0038, -0.0056, -0.007, -0.013, -0.0165, -0.0222, -0.0261, -0.0354, -0.0478, -0.0581, -0.0714, -0.0846, -0.1068, -0.1205, -0.1403, -0.1638, -0.1837, -0.2091, -0.2265, -0.2517, -0.2766, -0.3121, -0.3381, -0.3744, -0.4079, -0.4485, -0.4869, -0.5326, -0.5881, -0.6383, -0.6959, -0.7586, -0.8199, -0.8853, -0.9624, -1.0352, -1.1341, -1.2294, -1.3521, -1.4982, -1.6824, -1.892, -2.182)
dataPOW<-c(0.3387, 0.2175, 0.1197, 0.0441, -0.0198, -0.0777, -0.1262, -0.1717, -0.2108, -0.2482, -0.281, -0.3113, -0.341, -0.3673, -0.3921, -0.4167, -0.4387, -0.4607, -0.4806, -0.4996, -0.5187, -0.536, -0.5535, -0.5695, -0.5856, -0.6004, -0.6154, -0.6292, -0.6426, -0.6561, -0.6686, -0.6808, -0.6932, -0.7046, -0.7158, -0.7272, -0.7383, -0.7486, -0.7586, -0.7689, -0.7785, -0.7883, -0.7974, -0.8064, -0.8155)
dataEXP<-c(0.1981, 0.168, 0.1364, 0.1063, 0.0762, 0.0445, 0.0144, -0.0172, -0.0473, -0.0789, -0.109, -0.1391, -0.1707, -0.2008, -0.2309, -0.2625, -0.2926, -0.3243, -0.3544, -0.3845, -0.4161, -0.4462, -0.4778, -0.5079, -0.5395, -0.5696, -0.6012, -0.6313, -0.6614, -0.6931, -0.7232, -0.7533, -0.7849, -0.815, -0.8451, -0.8767, -0.9083, -0.9384, -0.9685, -1.0001, -1.0302, -1.0619, -1.092, -1.1221, -1.1537)
dataTRU<-c(-0.1867, -0.0857, -0.0193, 0.0204, 0.0443, 0.057, 0.0602, 0.0562, 0.0467, 0.0319, 0.0139, -0.0073, -0.0327, -0.0592, -0.088, -0.1202, -0.1525, -0.1881, -0.2234, -0.26, -0.2995, -0.3383, -0.38, -0.4205, -0.464, -0.5062, -0.5512, -0.5947, -0.6388, -0.6858, -0.731, -0.7767, -0.8253, -0.8719, -0.919, -0.9689, -1.0191, -1.0674, -1.116, -1.1673, -1.2165, -1.2685, -1.3183, -1.3684, -1.4212)
所以我的问题是,如何获得三种模型的AIC值?
我已阅读但未完全理解AIC
{}的文档,该文档的一般语法为:AIC(object, ..., k = 2)
。
不理解我在做什么,我在R中尝试过命令,如:
AIC(logCPK~dataPOW) Error in UseMethod("logLik") : no applicable method for 'logLik' applied to an object of class "formula"
如果您对如何使用我在R中列出的数据类型或任何其他软件计算AIC有任何建议,我会这样,所以,谢天谢地!
谢谢...
答案 0 :(得分:1)
您应该能够在AIC
中提供拟合模型对象的名称,例如
fit <- lm(logCPK~dataPOW)
AIC(fit)