简体   繁体   中英

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.

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'

  • for example let fx()=x*2+x
  • then fx(a) will be a*2+a
  • fx(5) will be 5*2+5=10+15

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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