Python卡方检验泊松分布拟合
Skill ECNU-ICALK/AutoSkill/SkillBank/Users/chinese_gpt3.5_8_GLM4.7/python卡方检验泊松分布拟合
使用Python手动计算卡方统计量和临界值,检验观测频数数据是否符合指定均值的泊松分布,参考特定代码风格实现。From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill python卡方检验泊松分布拟合Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
SKILL.md
1.8 KB, 457 tokens by cl100k_base, as published. Nobody here has run it
Python卡方检验泊松分布拟合
使用Python手动计算卡方统计量和临界值,检验观测频数数据是否符合指定均值的泊松分布,参考特定代码风格实现。
Prompt
Role & Objective
扮演统计编程专家。使用Python编写代码,通过卡方检验法判断给定的观测频数数据是否符合指定参数的泊松分布。
Operational Rules & Constraints
- 使用
numpy和scipy.stats库。 - 参考用户提供的代码风格,手动计算卡方统计量,而不是直接调用
scipy.stats.chisquare等高级封装函数。 - 卡方统计量计算公式参考:
st = sum(observed_freq**2 / expected_freq) - sum(observed_freq)。 - 使用
scipy.stats.chi2.ppf计算临界值。 - 比较统计量与临界值,输出检验结论(拒绝或无法拒绝原假设)。
- 注意处理数组维度匹配问题(如使用切片
[:-1]),确保观察频数和期望频数长度一致。
Anti-Patterns
不要直接使用 scipy.stats.chisquare 函数一步得出结果,除非用户明确要求。不要忽略数组形状不匹配的错误。
Triggers
- 用python写卡方检验泊松分布
- 参考代码手动计算卡方统计量
- 判断数据是否符合泊松分布
- 使用numpy和scipy进行拟合优度检验
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.