当前位置: 首页>>代码示例>>Python>>正文


Python SkillModel.likelihood_arguments_dict方法代码示例

本文整理汇总了Python中skillmodels.SkillModel.likelihood_arguments_dict方法的典型用法代码示例。如果您正苦于以下问题:Python SkillModel.likelihood_arguments_dict方法的具体用法?Python SkillModel.likelihood_arguments_dict怎么用?Python SkillModel.likelihood_arguments_dict使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在skillmodels.SkillModel的用法示例。


在下文中一共展示了SkillModel.likelihood_arguments_dict方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_likelihood_value

# 需要导入模块: from skillmodels import SkillModel [as 别名]
# 或者: from skillmodels.SkillModel import likelihood_arguments_dict [as 别名]
def test_likelihood_value():
    df = pd.read_stata('skillmodels/tests/estimation/chs_test_ex2.dta')
    with open('skillmodels/tests/estimation/test_model2.json') as j:
        model_dict = json.load(j)

    mod = SkillModel(model_dict=model_dict, dataset=df, estimator='chs',
                     model_name='test_model')

    args = mod.likelihood_arguments_dict(params_type='short')

    params = [1,
              1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.1,
              1.095, 1.085, 1.075, 1.065, 1.055, 1.045, 1.035, 1.025, 1.015,
              1.005, 0.9, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99,
              0.995, 0.985, 0.975, 0.965, 0.955, 0.945, 0.935, 0.925, 0.915,
              0.905, 1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.1,
              1.095, 1.085, 1.075, 1.065, 1.055, 1.045, 1.035, 1.025, 1.015,
              1.005, 0.9, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99,
              0.995, 0.985, 0.975, 0.965, 0.955, 0.945, 0.935, 0.925, 0.915,
              0.905, 1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.1,
              1.095, 1.085, 1.075, 1.065, 1.055, 1.045, 1.035, 1.025, 1.015,
              1.005, 1, 1, 1, 1.2, 1.4, 0.8, 0.6, 1.2, 0.8, 1.2, 1.4, 0.8, 0.6,
              1.2, 1.4, 0.8, 0.6, 1.2, 1.4, 0.8, 0.6, 1.2, 1.4, 0.8, 0.6, 1.2,
              1.4, 0.8, 0.6, 1.2, 1.4, 0.8, 0.6, 1.2, 1.4, 0.8, 0.6, 1, 0.5,
              0.51, 0.52, 0.53, 0.54, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.58,
              0.57, 0.56, 0.55, 0.54, 0.53, 0.52, 0.51, 0.5, 0.51, 0.52, 0.53,
              0.54, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.58, 0.57, 0.56, 0.55,
              0.54, 0.53, 0.53, 0.52, 0.52, 0.51, 0.51, 0.5, 0.5, 0.5, 0.5,
              0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.1, 0.1, 0.447, 0, 0, 0.447,
              0, 0.447, 3, 3, -0.5, 0.6]

    res = log_likelihood_per_individual(params, **args)

    in_path = 'skillmodels/tests/estimation/regression_test_fixture.pickle'
    with open(in_path, 'rb') as p:
        last_result = pickle.load(p)
    aaae(res, last_result)
开发者ID:suri5471,项目名称:skillmodels,代码行数:39,代码来源:likelihood_regression_test.py


注:本文中的skillmodels.SkillModel.likelihood_arguments_dict方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。