问题标签 [goodness-of-fit]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
19 浏览

r - r中元素的等级和标识

我有两个具有不同元素的向量,比如说x=c(1,3,4)y= c(2,9)

我想要一个范围向量,它x用 1 和y0 标识向量的元素,即

(1,2,3,4,9) -----> (1,0,1,1,0)

你怎么能得到 r 中的零和一 (1,0,1,1,0) 的向量?

谢谢

0 投票
1 回答
676 浏览

python - sklearn.model_selection.permutation_test_score 计算的 r2 分数不正确

sklearn.model_selection.permutation_test_score 和 sklearn.metrics.r2_score 计算的 r2 分数之间存在显着不匹配。permutation_test_score 计算的结果似乎不正确;见下文:

0 投票
0 回答
239 浏览

python - 有没有比使用 Scipy 更适合数据的 beta 素数分布的解决方案?

我试图使用 python 将 beta 素数分布拟合到我的数据中。因为有scipy.stats.betaprime.fit,我试过这个:

它向我展示了以下结果:

这与原始文件和 PDF 中的数字完全不同:

在此处输入图像描述

如果我给出函数的真实值loc和尺度作为fit函数的输入,估计结果会​​更好。有没有人已经在这部分工作或得到了更好的解决方案?

0 投票
1 回答
422 浏览

path - 拟合优度指数“NA”

我正在使用 Lavaan 运行非递归模型。但是,发生了两件事,我不太明白。首先,拟合优度指数和一些标准误差为“NA”。二、不同方向的两个变量之间的两个系数不一致(非递归部分:ResidentialMobility--Author):一个是正的,一个是负的(至少它们应该是同一个方向的;否则,如何解释?)。有人可以帮我吗?如果您希望我进一步澄清,请告诉我。谢谢!

输出:

lavaan (0.5-21) 在 93 次迭代后正常收敛

0 投票
1 回答
1667 浏览

r - R中的Hosmer-Lemeshow统计量

我在 R 中运行了 Hosmer Lemeshow 统计数据,但我得到的 p 值为 1。这对我来说似乎很奇怪。我知道高 p 值意味着我们不会拒绝观察到的和预期的相同的原假设,但是我有可能在某处有错误吗?

我如何解释这样的 p 值?

下面是我用来运行测试的代码。我还附上了我的模型的外观。响应变量是计数变量,而所有回归变量都是连续的。由于在我的初始泊松模型中检测到过度分散,我运行了一个负二项式模型。

0 投票
1 回答
1568 浏览

r - 如何对 R 中的 GEV 分布进行 Kolmogorov-Smirnov 统计?

我现在正在使用该extremes包来拟合广义极值 (GEV) 分布,并且我想使用 Kolmogorov-Smirnov 检验来估计拟合优度,但出现以下错误:

所以,我的问题是,如何对 GEV 进行 Kolmogorov-Smirnov 检验以符合关系?或者,是否有任何其他拟合优度测试可用于拟合 R 中可用的分布?非常感谢。

0 投票
2 回答
48 浏览

random - Computing correlations and performing goodness of fit for prng testing

I'm following along with a description of a test for pseudo-random number generators, and attempting to implement the test in C. There's one thing I'm hung up on though. The text in question is as follows:

Applies a correlation test on the Hamming weights of successive blocks of L bits. Let Xj be the Hamming weight (the numbers of bits equal to 1) of the jth block, for j = 1, . . . , n. The test computes the empirical correlation between the successive Xj’s,

enter image description here

Under H0, as n ⇢ infinity, p̂ * sqrt(n - 1) has asymptotically the standard normal distribution. This is what is used in the test. The test is valid only for large n.

Now, my plan is to compute this test statistic and perform a goodness of fit test to the normal distribution using the Anderson–Darling test. However, I'm a bit confused as to how you get a distribution from this single test statistic. From my understanding, for my full set of bits n, I'll get just one . So then I'll get just one test statistic p̂ * sqrt(n - 1). How am I supposed to compare this to the normal distribution? Would the idea be to break up my dataset into multiple chunks with their own n, compute a test statistic for each, and then compare this distribution to the standard normal? I just want to make sure I'm understanding the calculation of correctly.

0 投票
1 回答
293 浏览

r - JAGS 中的后验预测检查 - 尺寸不匹配错误

我想知道是否有人可以在这里帮助我解决问题。我想对下面的泊松对数正态模型进行拟合优度评估(这只是简单的测试模型)。当我注释掉模型运行的 fit <- sum(resi[]) 和 fit.new <- sum(resi.new[]) 行时,我显然需要这些值来进行后验预测检查。

关于为什么这可能不起作用的任何想法?我已经包含了错误消息和模型。

感谢您提供的任何指导!米歇尔

checkForRemoteErrors(val) 中的错误:3 个节点产生错误;第一个错误:运行时错误:第 28 行的编译错误。尺寸不匹配采用 resi.new 的子集

我还应该提到,当我从 fit 和 fit.new 语句中删除括号时,我得到一个不同的错误:

checkForRemoteErrors(val) 中的错误:3 个节点产生错误;第一个错误:运行时错误:第 27 行的编译错误。无法评估 fit.new 的子集表达式

这是模型:

0 投票
2 回答
219 浏览

mathnet-numerics - GoodnessOfFit.StandardError 错误答案

为什么我从 GoodnessOfFit.StandardError 得到错误的答案 (err2)?在下面的代码中,我自己进行计算并得到正确的答案(err3)。我从 GoodnessOfFit.RSquared 得到了正确的答案。注意:esttime 和 phrf 是 double[]。长度为 63。

0 投票
1 回答
217 浏览

r - 在 R 中,素食者的 CCA 是否存在“拟合优度”值,类似于 NMDS 的“压力”值?

我想知道是否有一种方法可以从纯素 cca 对象中提取类似于 metaMDS“压力”值的东西?我已经尝试过 goodness.cca 函数及其亲属

( http://cc.oulu.fi/~jarioksa/softhelp/vegan/html/goodness.cca.html )

他们告诉我每个样本的统计数据,但我对将多维系统减少到二维的整体拟合优度感兴趣(如果存在类似的东西,因为它使用不同的计算)。如果可能的话,我想继续吃素食,尽管我在这里找到了这个链接:

R中CCA的拟合优度

非常感谢

RJ