agentsclimarketplace

Python卡方检验泊松分布拟合

Skill ECNU-ICALK/AutoSkill/SkillBank/Users/chinese_gpt3.5_8_GLM4.7/python卡方检验泊松分布拟合

使用Python手动计算卡方统计量和临界值,检验观测频数数据是否符合指定均值的泊松分布,参考特定代码风格实现。From its SKILL.md

Install
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

  1. 使用 numpy 和 scipy.stats 库。
  2. 参考用户提供的代码风格,手动计算卡方统计量,而不是直接调用 scipy.stats.chisquare 等高级封装函数。
  3. 卡方统计量计算公式参考:st = sum(observed_freq**2 / expected_freq) - sum(observed_freq)。
  4. 使用 scipy.stats.chi2.ppf 计算临界值。
  5. 比较统计量与临界值,输出检验结论(拒绝或无法拒绝原假设)。
  6. 注意处理数组维度匹配问题(如使用切片 [:-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.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.