合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

        代寫FN6806、代做c/c++,Python程序語(yǔ)言
        代寫FN6806、代做c/c++,Python程序語(yǔ)言

        時(shí)間:2024-12-20  來(lái)源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯(cuò)



        FN6806: Object Oriented Programming II
        Problems - Set 3
        Question 3-1
        Implement Vasicek model for interest rate simulation

        • Use Euler-Maruyama method to generate the paths. returned value is a tuple: 1) the end
        rates of all paths, 2) the sum of all rates of all paths (except the starting   0
        ).
        • You could use either vector or valarray for the result.
        auto vasicek(double sd, double kappa, double r_mean, double r0,
        double T, int paths, int steps, mt19937 &gen) {
        double dt = T / steps;
        vector<double> sum_rates(paths);
        vector<double> end_rates(paths);
        ^^.
        return make_tuple(end_rates, sum_rates);
        }
        auto vasicek_valarray(double sd, double kappa, double r_mean,
        double r0, double T, int paths, int steps, mt19937 &gen) {
        double dt = T / steps;
        valarray<double> sum_rates(0.0, paths);
        valarray<double> end_rates(r0, paths);
        ^^.
        return make_tuple(end_rates, sum_rates);
        }
        • Below is my test code and result as reference. You could adapt it to test your result.
        seed_seq seed{**127};
        auto mtgen = mt19937{seed};
        auto [end_rates, sum_rates] =
        vasicek(sd, kappa, r_mean, r0, T, 20'000, int(0.5 * 365),
        mtgen);
        auto end_rates_avg =
        accumulate(end_rates.begin(), end_rates.end(), 0.0) /
        end_rates.size();
        1auto sum_rates_avg =
        accumulate(sum_rates.begin(), sum_rates.end(), 0.0) /
        sum_rates.size();
        cout ^< end_rates_avg ^< ", " ^< sum_rates_avg ^< "\n";
        ^/ 0.0495695, 9.05915
        mtgen.seed(seed);
        auto [end_rates2, sum_rates2] =
        vasicek_valarray(
        sd, kappa, r_mean, r0, T, 20'000, int(0.5 * 365), mtgen);
        end_rates_avg =
        accumulate(end_rates2.begin(), end_rates2.end(), 0.0) /
        end_rates2.size();
        sum_rates_avg =
        accumulate(sum_rates2.begin(), sum_rates2.end(), 0.0) /
        sum_rates2.size();
        cout ^< end_rates_avg ^< ", " ^< sum_rates_avg ^< "\n";
        ^/ 0.0495608, 9.06302
        2Question **
        A simulator for event-driven backtesting.
        There are two approaches in backtesting trading strategy: vectorized and event-driven.
        The vectorized approach is the most common one and consists of simulating the strategy directly
         on historical data. The price series are loaded as vectors and we use vectorized operations
         for both the trading strategy and the performance metrics.
        For example, we can have a buy signal whenever Close > Open and sell signal whenever Close
        < Open, and porformance metric is the **day lagged signal times the return of the next day
        (assuming buy at next day Open). It’s fast to implement such backtesting. However, if we want
        to simulate for adding the number of orders when we have 2nd buy signal, we need to modify
        the algorithm but it will not be easy. Vectorized method can not simulate the execution of
        orders realistically. At all, it is a simpliffed approach towards backtesting.
        The event-driven approach is more sophiscated as it simulates the strategy as if it was executed
        in real-time. The price series are loaded as a stream of ticks and the strategy is executed on
        each tick, and various modules can be added at both sides: the exeuction side and the strategy
         side. For example, the exeuction could simulation the price slippage of the execution, the
        strategy side could simulate for stop loss and dynamic order sizing depends on past performance.
        The event-driven approach is more ffexible and more realistic, but it is more difffcult
        to implement.
        In this exercise, you will read the source code of an event-driven simulator and try to understand
         how it works. You will need to document 5 places that exception could occur, what is the
        error message, what could be the cause of the error and what could be the exception handling.
        Create a ffle exceptions.txt and write down your answers.
        This project will also be used in the Final quiz, so you should get familiar with it.
        About the simulator:
        • The author of this repo only made a start so it’s just a partial implementation. You would
        ffnd many rough edges: incomplete and incorrect.
        • In one-line explaination, it runs over a CSV ffle with each line as a tick. The trading
        strategy acts on the tick data and perform buy/sell operations.
        • All cpp ffles are in \src
        • All hpp ffles are in \include
        Use Replit tools
        • When you press Run button, the program shasll run in the Console. However, you need
        to scroll back in history for the output.
        • You could use Code Search (Shortcut: Ctrl+Shift+F) to search for text in the project.
        • For manual mode, usually you don’t need to, you could open the Shell tool to type make
        for compilation and then type ./main to run the program. make shall auto-detect any
        recently changed ffle and recompile the program. If you want to recompile every thing,
        make clean and then make.
        3Aku’s class organization
        • I created a simple chart to show the class organization of Aku’s simulator. You could use
        it as a reference.
        4

        請(qǐng)加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp



         

        掃一掃在手機(jī)打開當(dāng)前頁(yè)
      1. 上一篇:代寫INFS2044、代做Python設(shè)計(jì)編程
      2. 下一篇:CHC5028代做、代寫C/C++設(shè)計(jì)編程
      3. ·代寫CS-UY 4563、Python程序語(yǔ)言代做
      4. ·&#160;COMP338編程代做、代寫Python程序語(yǔ)言
      5. ·CDS523編程代寫、代做Python程序語(yǔ)言
      6. ·COMP0035代做、代寫python程序語(yǔ)言
      7. ·代寫2530FNW、代做Python程序語(yǔ)言
      8. ·代寫CIS5200、代做Java/Python程序語(yǔ)言
      9. ·代寫CS 417編程、代做Python程序語(yǔ)言
      10. ·代做ELEC5307、python程序語(yǔ)言代寫
      11. ·COMP5328代做、代寫Python程序語(yǔ)言
      12. ·CMP5321代做、代寫Python程序語(yǔ)言
      13. 合肥生活資訊

        合肥圖文信息
        出評(píng) 開團(tuán)工具
        出評(píng) 開團(tuán)工具
        挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
        挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
        戴納斯帝壁掛爐全國(guó)售后服務(wù)電話24小時(shí)官網(wǎng)400(全國(guó)服務(wù)熱線)
        戴納斯帝壁掛爐全國(guó)售后服務(wù)電話24小時(shí)官網(wǎng)
        菲斯曼壁掛爐全國(guó)統(tǒng)一400售后維修服務(wù)電話24小時(shí)服務(wù)熱線
        菲斯曼壁掛爐全國(guó)統(tǒng)一400售后維修服務(wù)電話2
        美的熱水器售后服務(wù)技術(shù)咨詢電話全國(guó)24小時(shí)客服熱線
        美的熱水器售后服務(wù)技術(shù)咨詢電話全國(guó)24小時(shí)
        海信羅馬假日洗衣機(jī)亮相AWE  復(fù)古美學(xué)與現(xiàn)代科技完美結(jié)合
        海信羅馬假日洗衣機(jī)亮相AWE 復(fù)古美學(xué)與現(xiàn)代
        合肥機(jī)場(chǎng)巴士4號(hào)線
        合肥機(jī)場(chǎng)巴士4號(hào)線
        合肥機(jī)場(chǎng)巴士3號(hào)線
        合肥機(jī)場(chǎng)巴士3號(hào)線
      14. 上海廠房出租 短信驗(yàn)證碼 酒店vi設(shè)計(jì)

        主站蜘蛛池模板: 国模视频一区二区| 午夜无码视频一区二区三区| 国产伦精品一区二区| 国产午夜三级一区二区三| 日韩成人无码一区二区三区| 国产在线无码一区二区三区视频 | 亚洲日本中文字幕一区二区三区| 色久综合网精品一区二区| 韩日午夜在线资源一区二区| 日韩有码一区二区| 国产日韩综合一区二区性色AV| 日本一区二区视频| 精品一区二区视频在线观看| 久久久精品一区二区三区| 一区二区在线视频免费观看| 国产一区二区三区小向美奈子| 精品一区二区三人妻视频| 欧美人妻一区黄a片| 国产欧美色一区二区三区| 一区二区亚洲精品精华液| 亚洲AV无码一区二区三区电影| 国产福利91精品一区二区| 亚洲一区二区三区国产精华液| 麻豆AV一区二区三区| 精品国产a∨无码一区二区三区| 麻豆亚洲av熟女国产一区二| 在线观看国产一区二三区| 伊人色综合网一区二区三区| 久久精品日韩一区国产二区| 亚洲熟女综合一区二区三区| 成人精品一区二区激情| 日韩精品一区二区三区中文版| 在线视频一区二区三区四区| 老鸭窝毛片一区二区三区| 国产伦精品一区二区三区视频猫咪| 国产成人高清精品一区二区三区| 精品乱子伦一区二区三区| 精品视频一区二区三区免费| 久久久久人妻一区二区三区vr| 亚洲乱码一区二区三区国产精品| 亚洲日韩一区精品射精|