noviriasyifaunnafsi / transition-from-rice-to-vegetables

A master thesis project about the transition from rice to vegetables in Indonesia
0 stars 0 forks source link

Not sure about calculating bank loan interest #19

Open noviriasyifaunnafsi opened 1 month ago

noviriasyifaunnafsi commented 1 month ago

I'm not sure if I did the part of calculating the bank loan correctly, like these parts: https://github.com/noviriasyifaunnafsi/transition-from-rice-to-vegetables/blob/5784d758b6f2a8db902f370d68316d179c6eee97/rice_to_vegs.R#L63 https://github.com/noviriasyifaunnafsi/transition-from-rice-to-vegetables/blob/5784d758b6f2a8db902f370d68316d179c6eee97/rice_to_vegs.R#L69

I realized that I was wrong in this part: rice_farming_cost_precal == range_loan_for_farmers while the case should be that farmers will take loans only if the cost exceeds the previous income (in case they get a loss then the income would be less than the cost). So, I was trying to write like this:

rice_farmer_need_bank_loan <- if(rice_farming_cost_precal >= rice_farming_income) {
    rice_farmer_need_bank_loan = TRUE
  } else {
    rice_farmer_need_bank_loan = FALSE
  }

I put this part after calculating income, and then I tried to run it, but it seems not to work..

Also, I put the range of annual interest from 6% to 9% in the input table. But the case is that one farmer is only allowed to get a loan up to 4 times. The first loan interest will be 6% and it will increase 1% subsequently. But I think the current script is not working like that as I wrote it like this: rice_farming_cost + (rice_farming_cost * annual_bank_interest) I'm not sure how can I write that correctly in such a case...

Could you please help? *hope you get my point

CWWhitney commented 1 month ago

There are at least two options for calculating interest - check the vv() and look for trends options. I suggest that, if loans are really needed, then the result is a vector created with vv.

noviriasyifaunnafsi commented 1 month ago

Ok then, thank you