python - 从自举标准误差计算的 T 统计量
问题描述
请问有谁知道是否有一个库可以根据引导标准错误而不是python中的常规标准错误来计算t统计?我已经搜索了很长时间,但似乎没有人......提前谢谢你。
解决方案
可以使用bootstrapped
包(GitHub、PyPI )在 Python 中执行引导:
import numpy as np
import bootstrapped.bootstrap as bs
import bootstrapped.stats_functions as bs_stats
mean = 100
stdev = 10
population = np.random.normal(loc=mean, scale=stdev, size=50000)
# take 1k 'samples' from the larger population
samples = population[:1000]
print(bs.bootstrap(samples, stat_func=bs_stats.mean))
>> 100.08 (99.46, 100.69)
print(bs.bootstrap(samples, stat_func=bs_stats.std))
>> 9.49 (9.92, 10.36)
推荐阅读
- json - 使用 reactjs 和 redux 在多个组件中获取 JSON 数据
- python - cx_Freeze:pytesseract 的可执行文件在其他 PC 上失败
- vue.js - 如何使用 axiosjs 从这样的数组中获取数据
- c# - 在调试 ASP.Net Core 2.1 时自动登录
- tsql - TSQL 一个字符序列必须跟在另一个字符序列之后
- c# - 我如何在 SignalR 中执行基于令牌的身份验证?
- php - 在 Laravel 中插入空字符串或空图像
- angular - 角度 2-run 单击并双击锚标记
- php - Laravel 中的 PHP If 语句参数
- dart - 错误:名称“Image”在库“package:flutter/src/widgets/image.dart”和“package:image/src/image.dart”中定义。-- ambiguous_import