我目前正在尝试为财务模型建立一种迭代方法,但不幸的是我遇到了我无法解决的错误:
#Find Assetvalue
MV= pd.read_csv("EquityValue.csv", sep =";",parse_dates=True, index_col=0)
first_sig_a=np.std(MV)*np.sqrt(52)/1000000
s_k=0.06
sig_a1=0.2
def findassetvalue(k,first_sig_a,sig_a1):
error = 10^10
while (error>0.00001):
recoveryasset_1 (k=s_k, sig_a = first_sig_a)
log_ret=np.diff[np.log((recoveryasset_1)),1]
sig_a1 = np.std(data)*np.sqrt(52)/1000000
error = abs(first_sig_a - sig_a1)
first_sig_a = sig_a1
if (error < 0.00001):
return(sig_a1)
return(findassetvalue)
及其返回此错误: 函数 main .async-def-wrapper.locals.findassetvalue(k,first_sig_a,sig_a1)