Problems with BBsolve and returning a value

Hey guys!
I am getting an error which I can't really get out why it's happening or what it is supposed to tell me.

 object 'ans.best' not found

with the Traceback

4.
BBsolve(par = v_b_function(rf = RF, k = k, sig_a = sig_a, C = IntexpNon) + 
    1e+05, fn = FindV, k = k, sig_a = sig_a, 1:77) 
3.
Vfunction(k, sig_a = Start_sig_a) 
2.
FindAssetVol(k = Start_k, Start_sig_a = Start_sig_a) 
1.
FindK_Sig(Start_k = 0.05, Start_sig = 0.2) 

I am trying to work with an iterative approach to come to a real value.

Hi,

Welcome to the RStudio community!

In order for us to help you with your question, please provide us a minimal reproducible example where you provide a minimal (dummy) dataset and code that can recreate the issue. Once we have that, we can go from there. For help on creating a Reprex, see this guide:

Good luck!
PJ

1 Like
head(iris,5)[, c("date","equity","ebt","non-interest expense","interest expense","rf")]
datapasta::df_paste(head(iris, 5)[, c("date","equity","ebt","non-interest expense","interest expense","rf")])
data.frame(
date = c(41999,12000,22000,32000,42000)
equity=c(116012200.00,114308300.00,131206000.00,117006200.00,120982100.00)
ebt =c(419100.00,607800.00,517700.00,545500.00,258700.00)
non-interest expense= c(38540000,47947000,47947000,47947000,47947000)
interest expense = c( 3404000,6719000,6719000,6719000,6719000)
rf = c( 1.94,2.26,2.26,2.26,2.26)
)

Like this?

So far you have sample data on a copy/paste friendly format, now try to integrate that with relevant code that reproduces your issue (including library calls for the packages you are using).