示例#1
0
import xenarix as xen
import xenarix.sample as xen_s

xen.set_repository('c:\\xenarix')

set_name = 'set1'
scenSet = xen.ScenarioSet(set_name=set_name)

scen_id = 'scen1'
result_id = 'res1'
scen1 = xen.Scenario(scen_id=scen_id, result_id=result_id)

scen1.general.scenario_num = 200
scen1.general.maxyear = 5

gbm1 = xen_s.gbmconst('kospi200')
gbm2 = xen_s.gbmconst('kospi200_2')
gbm3 = xen_s.gbmconst('kospi200_3')

scen1.add_model(gbm1)
scen1.add_model(gbm2)
scen1.add_model(gbm3)

scenSet.add_scenario(scen1)

scen1.refresh_corr()
scen1.set_corr(gbm1, gbm3, 0.3)
scen1.set_corr(gbm1, gbm2, 0.5)

# print(scen1.correlation.dump())
示例#2
0
# coding=euc-kr
import xenarix as xen
import xenarix.results as results

repository_dir = 'C:\\Users\\09928829\\Source\\Workspaces\\InsuranceHedgeProject\\InsruranceHedge_sln\\Project\\Scenario\\xenarixPy\\test_repository'
xen.set_repository(repository_dir)

set_name = 'setname_1'
scen_id = 'testallmodel_1'
result_id = 'testresult_1'

result = results.ResultObj(set_name, scen_id, result_id)

print(result.res_models[0].data)

示例#3
0
# coding=euc-kr
import xenarix as xen

xen.set_repository(
    'C:\\Users\\09928829\\Source\\Workspaces\\InsuranceHedgeProject\\InsruranceHedge_sln\\Project\\Scenario\\xenarixPy\\test_repository'
)

set_name = 'setname_1'
scen_id = 'testscen_1'
result_id = 'testresult_1'

set1 = xen.ScenarioSet(set_name)

scen1 = xen.Scenario(scen_id, result_id)

scen1.general.scenario_num = 30

gbm1 = xen.GBM('gbm1')
gbm1.rf_curve.tenor = [
    '3M', '6M', '9M', '12M', '24M', '36M', '48M', '60M', '120M', '180M'
]
gbm1.rf_curve.value = [
    0.0164, 0.0161, 0.0159, 0.0164, 0.0173, 0.0182, 0.0191, 0.0218, 0.0229,
    0.0229
]

gbm1.div_curve.tenor = ['15Y']
gbm1.div_curve.value = [0.005]

gbm1.sigma_curve.tenor = ['15Y']
gbm1.sigma_curve.value = [0.3]
示例#4
0
# coding=utf-8
import xenarix as xen
import xenarix.sample as xen_s
import xenarix.results as xen_r

xen.set_repository('c:/repository')

# assumption
total_remittance_amount = 30000000000  # 30억 (월간)
remittance_marketshare_ratio = 0.3

remi_issue_amount = 11500000000  # 115억개
remi_circulation_amount = 5000000000  # 50억개
remittance_fee = 0.015
dividend_ratio = 0.7
IEO_price = 1
market_capitalization = remi_circulation_amount * IEO_price
rf = 0.015
per = 0.05

# generation setting - simulation part
scen_set = xen.ScenarioSet('test')
scen = xen.Scenario(scen_id='testid', result_id='resultid')
gbm = xen_s.gbmconst(process_name='trm')
gbm.x0 = 30
scen.add_model(gbm)
scen.general.frequency = xen.TimeGridFrequency.EndOfMonth
scen.general.maxyear = 5
scen.general.scenario_num = 500
scen_set.add_scenario(scen)
scen_set.generate()