简体   繁体   English

我如何将这个公式合并到我的 python 程序中?

[英]How do i incorporate this formula into my python program?

I am new to Python and trying to figure a way to input numbers to a mathematical formula.我是 Python 的新手,并试图找到一种将数字输入到数学公式的方法。

Mathematical formula as shown:数学公式如图: 在此处输入图片说明

I have developed based on the above formula, but not fully sure why it cant work.我是根据上面的公式开发的,但不完全确定为什么它不能工作。

def cumulative_function():
    alpha = 0.05
    fx_value = 5
    variable_a = -100
    k = 2
    cdf_formula = alpha * (fx_value * (a) + fx_value * (k - 2 * (alpha) + fx * (k - alpha) + fx_value * (value_x)))
    return cdf_formula

cdf = cumulative_function()
print (f"value is: {cdf}")

*EDIT: How do I insert the infinity ('...') in the formula to my program? *编辑:如何将公式中的无穷大('...')插入到我的程序中? Would appreciate anyone who can help me out:)感谢任何可以帮助我的人:)

fx(a) is not fx *(a) but actually a function to which you are passing a value 'a' fx(a) 不是 fx *(a) 但实际上是一个函数,您要向其传递值 'a'

  • for example let fx()=x*2+x例如让 fx()=x*2+x
  • then fx(a) will be a*2+a那么 fx(a) 将是 a*2+a
  • fx(5) will be 5*2+5=10+15 fx(5) 将是 5*2+5=10+15

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM