Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p值计算 #22

Open
Ice2king opened this issue May 19, 2024 · 15 comments
Open

p值计算 #22

Ice2king opened this issue May 19, 2024 · 15 comments

Comments

@Ice2king
Copy link

老师请问一下,这个包中的自由度是哪个变量? enp = gtwr.ENP_j
p_values_no_intercept = 2 * (1 - t.cbs(abs(tvalues_no_intercept), enp))这样计算对吗

@sunkun1997
Copy link
Owner

enp是模型有效参数数不是自由度,用df_model

@Ice2king
Copy link
Author

感谢老师的帮助

@Ice2king
Copy link
Author

我在其他提问的看到还有这样算的:import pandas as pd
from scipy.stats import t
import numpy as np

df_reside = pd.read_csv('gtwr_df_reside.csv')
tvalues = pd.read_csv('gtwr_tvalues.csv')
df_reside_value = df_reside.iloc[0, 0]
tvalues_no_intercept = tvalues.iloc[:, 1:]

p_values_no_intercept = 2 * (1 - t.cdf(abs(tvalues_no_intercept), df_reside_value))
p_values_precise_no_intercept = np.round(p_values_no_intercept, 7)
p_values_df_no_intercept = pd.DataFrame(p_values_precise_no_intercept)
p_values_df_no_intercept.to_csv('gtwr_p_values_precise_no_intercept.csv', index=False, header=False)
我看着其他问题的回答有用这个方式计算p值的,reside不是残差值吗?为什么也可以计算

@sunkun1997
Copy link
Owner

df_reside 全名是degrees of freedom of reside,残差的自由度

@Ice2king
Copy link
Author

这种计算方式也是正确的是吗?

@Ice2king
Copy link
Author

老师,模型拟合度很高但是p值很大可能是什么原因啊?

@sunkun1997
Copy link
Owner

这种计算方式也是正确的是吗?

是的

老师,模型拟合度很高但是p值很大可能是什么原因啊?

这个我只能说没有充分的理由拒绝回归系数为0的原假设,至于原因是什么我也不清楚

@Ice2king
Copy link
Author

请问一下老师,我做海洋相关的数据,陆地方面的值为空值,我还需要把陆地相关的数据放进去?

@sunkun1997
Copy link
Owner

请问一下老师,我做海洋相关的数据,陆地方面的值为空值,我还需要把陆地相关的数据放进去?

这种问题我回答不了,实际问题具体情况具体分析

@Ice2king
Copy link
Author

好的谢谢老师

@Ice2king
Copy link
Author

老师请问一下,我的数据有110万个点,一直在运行没进行迭代,这个包可以处理这么多数据吗?

@sunkun1997
Copy link
Owner

目前算法复杂度决定了很难处理这么多的数据

@Ice2king
Copy link
Author

谢谢老师

@Ice2king
Copy link
Author

老师请问一下这个包最多能运行多少个点

@sunkun1997
Copy link
Owner

上限是受计算机内存的限制,只不过算的慢就是了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants