Excel表中设X~(5), P(X>x)=0.01,求x.过程
时间: 2024-03-20 16:39:40 浏览: 18
在Excel中,可以使用NORMINV函数来计算正态分布的反函数。
首先,在一个单元格中输入0.01,假设该单元格为A1。
然后,在另一个单元格中输入下面的公式:
```
=NORMINV(A1,5,1)
```
该公式的意思是,求正态分布均值为5,标准差为1,满足P(X>x)=0.01的x值。
按下回车键后,Excel会自动计算该公式,最终结果约为7.3263。
因此,满足P(X>x)=0.01的x值约为7.3263。
相关问题
excel表中设X~F(3,6) ,求P(X> 8.10).的过程
根据题意,需要求解X~F(3,6)时,X>8.10的概率。
首先,F分布是一个右偏的分布,因此,我们需要将X>8.10转化为F分布的右侧概率。具体地,我们可以使用以下公式:
P(X > 8.10) = P(F > Fα)
其中,Fα是F分布的临界值,满足P(F > Fα) = α,其中α为显著性水平,通常取0.05或0.01。
根据题目中给定的X~F(3,6),我们可以使用统计软件或者查表的方式得到Fα的值。以α=0.05为例,可以得到Fα=5.14。
将Fα代入公式中,可以得到:
P(X > 8.10) = P(F > 5.14)
根据F分布的定义,可以计算出P(F > 5.14)的值。具体地,可以使用统计软件或者查F分布表得到P(F > 5.14)的值为0.01。
因此,P(X > 8.10)的值为0.01。
x_last = 0 p_last = 0 Q = 0.01 # 系统噪声 R = 0.5 # 测量噪声 def kalman(z_measure, x_last=0, p_last=0, Q=0.018, R=0.0542): x_mid = x_last p_mid = p_last + Q kg = p_mid / (p_mid + R) x_now = x_mid + kg * (z_measure - x_mid) p_now = (1 - kg) * p_mid p_last = p_now x_last = x_now return x_now, p_last, x_last path = 'C:/Users/calm夜/Desktop/作业1.xlsx' data_B = pd.read_excel(path, header=None) x = list(data_B.iloc[::, 0]) y=[] for i in range(len(x)): pred, p_last, x_last = kalman(x[i], x_last, p_last, Q, R) y.append(pred) ax1 = plt.subplot(1,2,1) ax2 = plt.subplot(1,2,2) plt.sca(ax1) plt.plot(x, color="g") # 测量值 plt.sca(ax2) plt.plot(y, color="r") # 预测值 plt.show() 把python代码转用matlab代码
Sure! Here's the equivalent MATLAB code for your Python code:
```matlab
x_last = 0;
p_last = 0;
Q = 0.01; % 系统噪声
R = 0.5; % 测量噪声
path = 'C:/Users/calm夜/Desktop/作业1.xlsx';
data_B = xlsread(path);
x = data_B(:, 1);
y = zeros(size(x));
for i = 1:length(x)
x_mid = x_last;
p_mid = p_last + Q;
kg = p_mid / (p_mid + R);
x_now = x_mid + kg * (x(i) - x_mid);
p_now = (1 - kg) * p_mid;
p_last = p_now;
x_last = x_now;
y(i) = x_now;
end
subplot(1,2,1);
plot(x, 'g'); % 测量值
subplot(1,2,2);
plot(y, 'r'); % 预测值
```
Please note that in MATLAB, you will need to use the `xlsread` function to read data from an Excel file. Also, the `subplot` function is used to create subplots, and the color should be specified as a string ('g' for green and 'r' for red).
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)