用MATLAB计算方差的置信区间,matlab  置信区间计算方法

这是一个用于计算90%, 95% 或 99% 置信区间的MATLAB函数,适用于一维或二维矩阵。根据输入数据的维度和置信水平,函数使用t分布或当样本数量大于120时接近正态分布的z分布来计算标准误差乘以相应的临界值,从而得到置信区间。" 123918985,805266,复位设计的挑战与理解,"['硬件设计', '嵌入式开发', '电路理论', '系统设计']
摘要由CSDN通过智能技术生成

function interval=ci(x,confidence,dim);

% interval=ci(x,confidence,dim);

%

% 90%, 95% or 99% confidence interval of a vector

or 2d matrix

% Optional dim refers to dimension and must be 1 or 2 (default is

1).

% Optional confidence must either 90, 95 or 99 (default is

95).

%

% Calculated as the standard error multiplied by the critical

two-tailed value of t for

% a=0.10, 0.05 or 0.01 (see Statistical methods in psychology, D.C.

Howell).

% This formula applies when the Population standard deviation is

unknown.

% As n gets larger then the t distribution approaches the normal

distribution.

% So, if n>120, uses z instead of t (e.g. 1.96 standard errors,

for 95% interval)

% Raymond Reynolds 23/11/06

if nargin<3

dim = min(find(size(x)~=1))

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值