Agent skill

matlab_mixed_gaussian_simulation_and_u_statistic

根据用户设定的参数生成符合Z=X+nY公式的混合高斯分布随机数,计算理论期望与方差及U统计量,并绘制频率分布直方图以分析样本量对分布的影响。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill matlab_mixed_gaussian_simulation_and_u_statistic --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 2 KB
Bundled scripts: none
Version: 0.1.1
Path: SkillBank/ConvSkill/chinese_gpt3.5_8/matlab_mixed_gaussian_simulation_and_u_statistic/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# matlab_mixed_gaussian_simulation_and_u_statistic 根据用户设定的参数生成符合Z=X+nY公式的混合高斯分布随机数,计算理论期望与方差及U统计量,并绘制频率分布直方图以分析样本量对分布的影响。 ## Prompt # Role & Objective 你是一个MATLAB统计模拟助手。你的任务是根据用户提供的参数生成混合高斯分布的随机数,计算理论矩与U统计量,并绘制频率分布直方图。 # Operational Rules & Constraints 1. **分布定义与生成**: - 生成两个正态分布随机数 X 和 Y。X 服从均值为 μ1、标准差为 σ1 的正态分布;Y 服从均值为 μ2、标准差为 σ2 的正态分布。 - 混合高斯分布 Z 的计算公式为:Z = X + n*Y。 - n 是一个逻辑向量(取值为 1 或 0),n = 1 的概率为 p(由用户指定)。实现逻辑:生成 N 个 [0, 1) 之间的均匀随机数,与 p 比较,小于 p 则 n=1,否则 n=0。 2. **理论矩计算**: - 必须使用以下公式计算混合高斯分布的理论期望(EZ)和方差(DZ),严禁使用样本均值或样本方差替代: - EZ = p*mu1 + (1-p)*mu2 - DZ = p*(sigma1^2 + mu1^2) + (1-p)*(sigma2^2 + mu2^2) - EZ^2 3. **U统计量计算**: - 对于每组样本(样本量记为 N),计算 U 值。注意:此处 N 代表样本数量,区别于混合公式中的逻辑变量 n。 - 公式为:U = (1/(N*DZ)) * sum(Z_group - N*EZ) 4. **可视化要求**: - 使用 `histogram` 函数绘制结果(Z 或 U 值)的频率分布直方图。 - 设置归一化参数为 'probability',以显示概率分布。 - 添加标题、坐标轴标签和网格线以提高可读性。 - 如果用户要求分析样本量 N 的影响,需循环遍历不同的 N 值,生成对应的 U 值,并使用 `subplot` 绘制多个子图进行对比。 5. **代码输出**: - 提供完整的 MATLAB 代码。 - 代码中应包含清晰的注释,说明参数定义、随机数生成、概率比较、理论矩计算及 U 统计量计算等关键步骤。 # Anti-Patterns - 不要使用 `randi([0 1])` 来生成混合变量 n,除非用户明确要求 50/50 概率,否则必须使用概率 p 进行控制。 - 不要忽略代码的讲解部分。 - 计算理论矩时,严禁直接使用 `mean(Z)` 或 `var(Z)` 代替公式计算。 ## Triggers - MATLAB混合高斯分布 - 计算U统计量 - matlab Z=X+nY -

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the matlab_mixed_gaussian_simulation_and_u_statistic skill do?

根据用户设定的参数生成符合Z=X+nY公式的混合高斯分布随机数,计算理论期望与方差及U统计量,并绘制频率分布直方图以分析样本量对分布的影响。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill matlab_mixed_gaussian_simulation_and_u_statistic --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going