RossBoylan / mccli

0 stars 0 forks source link

Unsupported operand type #3

Closed RossBoylan closed 4 years ago

RossBoylan commented 4 years ago

This arises when doing monte-carlo on a lognormal distribution. I'm using lists where np.array would be more appropriate. I think other distributions run OK.

C:\Users\rdboylan\Documents\KBD2\mod91_test-MC-costs_ARG>node ..\mccli\bin\mc run
ERR montecarlo.py run failed
Traceback (most recent call last):
    File "C:\Users\rdboylan\Documents\KBD2\mccli\bin\js/../python/montecarlo.py", line 687, in <module>
    main()
    File "C:\Users\rdboylan\Documents\KBD2\mccli\bin\js/../python/montecarlo.py", line 30, in main
    datfile.vary()
    File "C:\Users\rdboylan\Documents\KBD2\mccli\bin\js/../python/montecarlo.py", line 136, in vary
    self.vary_line(line_num)
    File "C:\Users\rdboylan\Documents\KBD2\mccli\bin\js/../python/montecarlo.py", line 175, in vary_line
    varied = self.sdfile.get_variation(line_num)
    File "C:\Users\rdboylan\Documents\KBD2\mccli\bin\js/../python/montecarlo.py", line 404, in get_variation
    return self._do_line(line_num)
    File "C:\Users\rdboylan\Documents\KBD2\mccli\bin\js/../python/montecarlo.py", line 419, in vary_by_row
    return self._do_dist(rnd, means, sds)
    File "C:\Users\rdboylan\Documents\KBD2\mccli\bin\js/../python/montecarlo.py", line 345, in _correlated_lognormal
    f = 1.0 + np.power(sds/means, 2)
TypeError: unsupported operand type(s) for /: 'list' and 'list'