Home

Quick Start Guide – TurboVisualStudio

image

Contents

1. F Auto Generate Calculation Driver Code I Auto Generate IArray Allocation Code From this Calculation Driver X Auto Generate Excel Formulas From this Calculation Driver S Sort Selected Statements M Find Unused Members in this Solution of this Class U Toggle Upper Lower Case O Auto Format cs Files of this Class G Insert Using Generics Lrd Lr Ou Mae R En T A A Align Selected Statements R Expand or Collapse all Regions in the file 2 W Toggle Long Line Wrap Print Current Class cy Print Current File Fa H Turbo Tagging Highlight jJ 8 T Turbo Dependency Tracing Clickin g it will aim D Turbo Dependency Debugging generate SourceCode file 7 N Turbo Navigator in the same folder of sIn fil 3 GN Enable View C Code in Visual Studio when Working in Excel FI Oo TurboActuary Information 2 Define SourceCodeFile name in the name manager of your spreadsheet Its value will be the full file name with path of the generated file in step 1 Then you can view all source codes in the solution when you are working in Excel For example in our TurboTerm1 App xlsb we have Page 10 Building Models Incrementally Incredible Order Miracle of Beauty 4 A Ad Total Row N ta fe jaf ELi TurboTerm1 App Microsoft TurboActuary Turbo Cont d Data Review View de Design AAR SE KIE AE Columns And Excel Row _ Geidmn d Excel Define Default a Calc TurboX in Visual Studio Scenario Object Turbo He
2. Goto Remove Errors GP Auto R Clear Spark id Export map Arrays Relations Excel Table and Function Immediately Y Samples Sample Workbooks CopyRight AB113 vlr fe sTurbolTerm1 App Term PremiumReimbursePPithis t Policy Year Premium PPI A B X Z AA AB AC AD AE lt TurboX Columns and Categorie ul 19 TurboTe EE EE 2 379 2012 05 31 Lapse Rate Comm Policies Cumulative Maint Overhead cq Expense PP Date PP Comm PP Expense PP Expense PP eds deed ne omm arge bac 109 124 2022 09 30 1140 0 2430 09739 626 335212 0 0 2 0 00926387 0 3 o com care dees 110 125 2022 10 31 1140 0 2430 59351 626 769318 0 0 2 0 0164839 0 3 d CommPP 111 126 2022 11 30 1140 O 2430 78274 626 934901 0 0 2 0 00618553 0 3 0 ee 112 127 2022 12 34 1140 0 2430 62941 626 800737 0 0 2 0 004981 os 4 n nvest Category 113 128 2023 01 31 1160 20 2431 18259 627 284767 200 0 2 0 01806033 TEE cnn che Capial Gain Propor 114 129 2023 02 28 1160 0 2431 55666 627 612081 o 0 2 0 01199627 0 3 0 0 Chargeable Capital Gain Return 115 130 2023 03 31 1160 O 2431 66924 627 710584 0 0 2 0 00356734 0 3 ogi Eon Proportion 116 131 2023 04 30 1160 0 2431 40069 627 475602 0 0 2 0 0084798 0 3 0 Unchargeable Capital Gain Propo 117 132 2023 05 31 1160 O 2431 76397 627 792472 0 0 2 0 01156914 HE Erer Unfranked Proportion Page 39 Building Models Incrementally In
3. UnchargeableCapitalGainReturn t UnfrankedReturn t FE talGainProportion t calendar t DeathRate t age t 1 deathRate t 1 policyMonth t policyYear t Has NoInitialization FrankedProportion t calendar t InvestIncomeOfSurplusAsset t investReturnRateOnSurplusAsset t targetSurplus t 1 LapseRate t policyYear t OverheadExpensePP t expenseInflationRatio t sumAssuredPP t 1 PremiumPP t policyMonth t policyYear t UnchargeableCapitalGainProportion t calendar t UnfrankedProportion t calendar t AcgExpensePP t expenseInflationRatio t 1 policyMonth t policyYear t premiumPP t CommPP t policyYear t premiumPP t Has NoInitialization Death t deathRate t policies t 1 Has NoInitialization DeathBenefit t deathRate t policies t 1 sumAssuredPP t 1 Delete the function ArrayAllocation Put your cursor in Calculate function Then click Auto Generate Array Allocation Code From this Calculation Driver rename the newly generated function to be ArrayAllocation and you will get Page 29 Building Models Incrementally Incredible Order Miracle of Beauty private void ArrayAllocations region Array Allocations GEENEEN SG oy FyPporneeliasenee int theFirstMonth ProjectionFromMonth 1 region Benefit Summary deathBenefit nev ERR pr ojectionFronmonth ProjectionToMonth sumAssuredPP new DuetSlidingDoub
4. Mouse Up Down Multiline Editing Ctrl Shift Up Down Highlight References Ctrl F3 Search for the current selection You can check http stackoverflow com questions 98606 favorite visual studio keyboard shortcuts and see more shortcuts people are using Page 59 Building Models Incrementally Incredible Order Miracle of Beauty Appendix 3 About C C is the most popular language in windows platform and was developed and is fully supported by Microsoft According to http en wikibooks org wiki C_Sharp_ Programming it has features that allow beginners to become proficient in C more quickly than in C or C Similar to Java it is object oriented You only need to know basic C You can study by examples or read some C tutorial from Internet A good book about C is C in a Nutshell but you only need to read chapter 2 chapter 3 and section nullable types in chapter 4 A good reference is http msdn microsoft com en us library aa645596 v vs 71 aspx You can visit http stackoverflow com and get helps from C community af amp ft Hex Assembly Fortran Page 60 Building Models Incrementally Incredible Order Miracle of Beauty Appendix 4 Visual Studio Tools 4 1 Blue Theme Optional You can customize VS 2012 menu colors many people like the blue theme First you need to update your VS 2012 Go to Tools menu then Extensions and Updates then Updates then Product Updates and c
5. Specs and Enum d 4 2 1 TermContract 4 Benefit Summary cs A cae a ey pt r s r sumAssuredPP Array lt double gt umAssuredPP int double eathBenefit Array lt double gt eathBenefit int double double double double comeBg IArray lt double gt r Or r omeBg int double double double tgoBg IArray lt double gt tgoBg int double double double double double double double ome nd IArray lt double gt omeEnd int double double double goEnd IArray lt double gt tgoEnd int double double double dBusiness bool amp ve amp r mContract GlobalSpec PlanSpec MpSpec int int ScenarioManager lt IndexEnum InterestCurveEnum athRate IArray lt double gt 2athRate int double double int int double ry death IArray lt double gt Death int double double double lapseRate Array lt double gt LapseRate int int double apse I Array lt double gt v apse int double double double double t policies IArray lt double gt Or you can use Explorer Bar to find all methods functions properties data with get set and fields data under a class quickly O O 8 G ib 2 T P Continue Du J M N OO MEKAAR ta fi W N ntrol an gar 2 Y a s Reserved using System using System Collections Generic using System Lina using System Text using System Data using T
6. and open TurboTerm1 App sin If you do not see the Solution Explorer you can go to view menu and click Solution Explorer submenu You will see there are four projects in the solution You can use the pin button to any window to give you more room Solution Explorer v A o Qa lt Search Solution Explorer Ctrl pr 4 Solution TurboTerm1 App 4 projects gt E TurboBase Please refer to Appendix 2 of gt amp TurboTerm1 Quick Start Guide TurboExcel b TurboTerm1 App gt TurboTerm1 App Console The TurboBase project has classes used by all libraries and applications The TurboTerml project is one of our libraries At this layer we have common business logic and abstract data for Term product Page 12 Building Models Incrementally Incredible Order Miracle of Beauty The TurboTerm1 App project is at library application layer At this layer we may decorate or slightly change the business logic for different Term plan and supply the concrete data into the models All of the above three layers are building blocks used by both application models and Excel models The TurboTerm1 App Console project is at user application layer The console project is parallel to Excel application in our hierarchical architecture Platform Models TurboTerm1 App Console Project TurboTerm1 App xlsx No Z TurboTerm1 App Project g TurboTerm1 Project for p TurboBase Project nce T
7. policyYear policyYear_t t TurboDebug Assert premiumPP premiumPP_t t endregion TurboAutoGenerated var pivotTable planSpec PivotTabl PersistenceBonus _ dode percert pivotTable amp TIurboSystemPivotTablesintTurboB ase PlanEnums return premiumReimbursePP t premiumPP t percent Name _ Value Type Name Value _ Type E this ubofermlApplerm 4 Turbot _ percent 100 double _ or EL Jint H SF premiumPP TurboSystem SimpleDoubleArray Turbos policyYear_t 14 lint A premium P t 166 66666666666666 double premiumPP_t 166 66666666666666 a double H premiumReimburseP TurboSystemFullSizeArray Solo lidingDoubleArr 4 Turbos H pivotTable TurboSystemPivotT able lt intTurboBase PlanEnu amp Turbos premiumReimburseP 0 0 double v percent 100 double vt 9 lint Type variables this TurboTerm1App Term 4 TurboT 5 7 Generate Excel Model Copy C TurboActuary3 0 Application Excel Liability Term TurboTerm1 App xIsb to be TurboTerm1 App2 xlIsb Delete other tabs except the Objects tab and keep only this workbook open Follow the section 4 4 to auto generate your full fledged Excel model Or Page 38 Building Models Incrementally Incredible Order Miracle of Beauty Go to Calculation Driver cs of folder term of project TurboTerm1 App Put the cursor inside the function Calculate and click t
8. App TurboTerm1 App 3 3 TaxNetPre CalculatedSigmas IInterestRateTermStructure int intf double double SolverMethodEnum SolverMethodEnum of type CalculatedValues IInterestRateTermStructure int int double double SolverMethodEnum of type HullWhiteCalibrationAp Cycle Clipboard Ring Ctrle ShifteV new MoSpec globalSpec plans Paste Special gt Term globalSpec planSpec Del s new Term globalSpec pl late lues i term esbeddedvalu s i term bookProfit DataeOutput InsertIntoTable outputTable int new Columncontent Product product Tostri Columncontent Plan Group plaenGroup Td ColusnContent Plan plan ToString ColusnContent Boeok Profit bookProfit Columncontent Embedded Value embedd 7 Prolect Tubohiace term embeddedValue term bdookProfit delPointRows Rows Count i pec new MpSpec globalSpec new new new new File C TurboActuary3 0 Base TurboBase TurboBase 4 Gaap Interfaces IFas97 and IFas97Submodel cs OataOutput ToCsvFile c TurboActuary3 e output ic 30 stopwatch Stop Hide external items 2 4 Debugging A basic but very good introduction can be found in http www dotnetperls com debugging BQ TurboTerm1 App Microsoft Visual Studio File Edit View Project Build Team SQL Tools Test Architecture o ola aaal om tn Ti Vol a aa Sab be gt Benefit Summary cs X a
9. Tools Test Architecture TurboAcuary Analyze Window Help bf B al ni P Attach mm tart Page X tew Froje Pa P Recent NET Framework 4 5 Sort by Default ai Search Installed Templates Ctrl E p 4 cs re ee U Iti mate 3 Windows Forms Application Visual C Type Visual C e 4 Templates c A project for creating a C dass library 4 Visual C m WPF Application Visual C di D Windows c Web Console Application Visual C Extensibility c gt Off ai ASP NET Web Forms Application Visual C ice Cloud c js a Class Library Visual C Reporting 5 c b SharePoint a Portable Class Library Visual C Silverlight z Recent pac Test e ASP NET MVC 3 Web Application Visual C WCF sa Workflow p ASP NET MVC 4 Web Application Visual C LightSwitch gt Other Languages F Silverlight Application Visual C b Other Project Types ce Modeling Projects ou Silverlight Class Library Visual C c l v c P Onine P Silverlight Business Application Visual C Name MyFirstTurboClass Location CAUsersVPeter Li Documents Visual Studio 2012 Projects _ 7 Browse Solution name MyFirstTurboClass V Create directory for solution C Add to source control OK Cancel z SUS ura pu LI CO U team with agile environments for Diet managemen ecting MyFirstTurboClass Microsoft Visual Studio Edit View Project Build Debug Team S O i gGiw o c af H A QL Tools Test Architectur
10. VV FY G ChargeableCapitalGainProportion int System DateTime TurboTerm1 Term lt PlanSpec MpSpec gt chargeableCapitalGainProportion TurboTerm1 Term lt PlanSpec MpSpec gt ChargeableCapitalGainReturn int TurboTerm1 Term lt PlanSpec MpSpec gt chargeableCapitalGainReturn TurboTerm1 Term lt PlanSpec MpSpec gt ClaimExpense int double double double TurboTerm1 TermContract lt PlanSpec MpSpec gt Oe lr You can use Navigator To Ctrl to search symbol definitions within a solution Page 52 Building Models Incrementally Incredible Order Miracle of Beauty ae sn ck Launch Ctrls D Ad amp Fhe View Project Build Debug Team SQL Tools Test Debug Ad Oo ta Results Found 11 matching results Cut Ctrl X Visa a as ee Profits new TArreycdedbldj le Calculate of type IFas97Submodel A Paste Cirie V modelPointRows Rows Count i Calculate of type StatGrossPremiumReserve Calculate of type StatNetPremiumReserve 2 Calculate of type TaxNetPremiumReserve Calculate of type Term Calculate of type IReserve Calculate Driver cs fof c TurboActuary3 0 Application CSharp Term Term1 TurboTerm1 App TurboTerm1 App 3 1 StatNetPre Calculate Driver cs of c TurboActuary3 0 Application CSharp Term Term1 TurboTerm1 App TurboTerm1 App 3 2 StatGrossP Calculate Driver cs of c TurboActuary3 0 Application CSharp Term Termi TurboTerm1
11. gt policyYear get protected set Initialization protected virtual int PolicyYear int t if t mpSpec IssueMonth return policyYear t else return policyYear t t mpSpec IssueMonth 1 12 1 You can go to definition find all references or view call hierarchy from the context menu by right clicking on a code element method property field or constructor name in the code editor Page 51 Building Models Incrementally Incredible Order Miracle of Beauty OT Talal eo PTTMOUCTOGUDINGS CS Se N di Ad PEOAY WALLS 8 N Me die Wi 6 nograpn cs B Cashtiow cs O Proxy VAC cs 6 Contr ime cs o Prermiun a TurboTerm1 App Console Program ER Main string args IArray lt double gt bookProfits new IArray lt double gt modelPointRows Rows Count rory for int i i lt modelPointRows Rows Count i Generate Sequence Diagram MpSpec mp Rows Rows i ERG Show on Code Map Ctrl 1Spec TotalPr Show Related Items on Code Map gt tara A Run Tests CuleR 1 embeddedVi Debug Tests Ctrl R Ctri l a F12 Ctri K R en Ctrl K Ctri T Parallel For Breakpoint gt Mpst 6 Add Watch PointRows Ro Find Symbol Results 5 matches found amp C TurboActuary3 0 Application CSharp Term Term1 TurboTerm1 App TurboTerm1 App Console Program cs 78 26 term Calculate C TurboActuary3 0 Application CSharp Term Term1 TurboTerm1 App Turbo
12. it by Ctrl K Ctrl I Complete Word it will help you to complete a word without typing full name of it You can type first few letters of an identifier and press Ctrl SpaceBar to complete the word If we have multiple matches it will show list of matching words in List Members popup 2 3 Coding Navigation We use VS 2012 as examples in this section VS 2010 should be similar with some differences As usual you can use Ctrl f Ctrl Shift f to search In addition Visual Studio provides great flexibility to tailor your needs Page 48 Building Models Incrementally Incredible Order Miracle of Beauty You can use Solution Explore to find your files under a class quickly The file names are used as category names in TurboxX aaa Solution Explorer Ix ccalo 2 sop osrma 3 l aia Solution TurboTerm1 App 4 projects di al gt amp TurboBase 4 amp Turbolerml gt Properties P i gt n References b b b mi 0 Interface mi 1 Specs and Enum mi 2 1 TermContract Reserve cs ce CS b pital cs p structor cs p st Category cs p st Income cs b D a p rve cs b p You can also use Solution Explorer to find all methods functions properties data with get set and fields data under a class quickly Page 49 Building Models Incrementally Incredible Order Miracle of Beauty Solution Explorer vax co m o 2 ad lo sR Search Solution Explorer Ctrl PP gt mi 1
13. other class is called the base class and the class that inherits the members of base class is called the child class The following example show that Dog class inherits reuses the Eating function from parent class Animal and we add a new function Barking into the child class Dog public class Animal public virtual void Eating Console WriteLine Every animal can eat public class Dog Animal public virtual void Barking Console WriteLine Besides eating dog can bark class InheritanceExample Static void Main string args Animal animal new Animal animal Eating I can only eat Dog dog new Dog dog Eating I can eat dog Barking I can bark Page 45 Building Models Incrementally Incredible Order Miracle of Beauty Appendix 2 How to Use Visual Studio A good site to learn Visual Studio for beginner is http www learnvisualstudio net start here or consult your IT colleagues 2 1 Quick Launch in VS 2012 Even when you know where the option or menu item lives its often quicker to hit Ctrl Q and type a few letters to find a command or option Window Help remium cs Expense cs Hasie Solution Explorer T gt x 2 aQmian lt P hs SS Ese ae es cee a string args vs Count 7 Search Solution Explorer Ctri sisfleuy ap 2 2 IntelliSense IntelliSense is the general term for a number of fea
14. reverse private void SomeCoolMethod blah private void A SomeCoolMethod private void B SomeCoolMethod private void C SomeCoolMethod Page 26 Building Models Incrementally Incredible Order Miracle of Beauty 4 2 Auto Generate Parameters You can auto generate parameters for your model functions by clicking Generating Parameter for this Method in TurboActuary main menu as shown below protected virtual double MaintExpensePP int t return maintExpensePP t planSpec FixedMaintExpensePP expenseInflationRatio t planSpec MaintExpensePremiumPercent premiumPP t planSpec MaintExpenseBenefitPercent sumAssuredPP t 1 protected virtual double MaintExpensePP int t double expenseInflationRatio t double premiumPp_t double sumAssuredPP_tm1 return maintExpensePP t planSpec FixedMaintExpensePP expenseInflationRatio t planSpec MaintExpensePremiumPercent premiumPP t planSpec MaintExpenseBenefitPercent sumAssuredPP t 1 You can also generate parameters for all functions in a class by just a click on Generating Parameter for this Class in TurboActuary main menu 4 3 Auto Generate Calculation Driver Our software will automatically assemble small functions to be calculation driver Let the Calculate function as shown below That is we let EmbeddedValue as our targeting array Then click Auto generate calculation driver in T
15. type like class by typing its name followed by as shown below Static void Main string args Console fey BackgroundColor A ConsoleColor Console BackgroundColor O Beep _ Gets or sets the background color of the console EN BufferHeight Bais T Bufferwidth System ArgumentException 7 CancelKeyPress System Security SecurityException ST CapsLock System IO IOException Clear S CursorLeft a CursorSize von CursorTop By default Auto list members will be enabled We can manually List members of a type by pressing Ctrl J Page 47 Building Models Incrementally Incredible Order Miracle of Beauty Parameter Info you can get information about parameters like its type name of parameters for a method as shown below Static void Main string args Console WriteLine aAl1S of 19 void Console WriteLine string format params object arg format 4 composite format string You can invoke Parameter Info manually by using Ctrl Shift Space Quick Info you can display the complete declaration of an identifier as shown below Static void Main string args Console WriteLine test void Console WriteLine string value 18 overload s Writes the specified string value Followed by the current line terminator to the standard output stream Exceptions System IO IOException You can get Quick Info of an identifier by placing a cursor over it You can manually invoke
16. Building Models Incrementally Incredible Order Miracle of Beauty Quick Start Guide TurboVisualStudio TurboActuary Ecosystem 3 0 TurboActuary Ag lt Building Models Incrementally Incredible Order Miracle of Beauty 2013 by TurboActuary LLC All Rights Reserved Page 11 Building Models Incrementally Incredible Order Miracle of Beauty CHAPTER 1 INSTALLATION ccscccccsccccccsccccansccccnncccccnsccccsscccccsscccanscccessccccesnccccsnsccccsscccacsccccsssccccsscccccssccccsssccess 1 1 1 INSTALLATION OF VISUAL STUDIO 2010 20 12 2013 se ee EG Ge Ge OG Ge ede de Ge GO GR ee Ge Ge Ke EE ed 1 Rd ee did AR EO AE OO EE EO EO OE N OE OE OE EO AO OE N N RE N EN 1 1 3 TURBOVISUALIZER AND TURBOINTELLISENSE INSTALLATION ee ees ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee 2 CHAPTER 2 CREATE YOUR OWN EXCEL FUNCTIONS cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccceccceccccccecccs 4 2 1 WRITING ONCE AND USE EVERYWHERE cccececcccecccccccccccececcccencecencecencecencecencecencscenceceaceceacecenceceaseceacecenceceaceceaceeenseneas 4 KZN EWCH CODE FROM ECF iraa Ee reer cs Ge os nn Scie eo GE 9 CHAPTER 3 PLATFORM MODELS asses esse susse ed seed Ge dv ok ee ee se Ge Ge Gee Gee ed Ge ed Ge dv od Gee ee Ge ee Ge Ge Gee ed Ge Ged ve ee Gee ee se Ge Ge si eed 12 MR ls see ALAC IPE ed MEE AE AE OOR EE OE OO OE RR EE EE EE 12 3 2 BUILDING MODELS INCREMENTALLY ies
17. Ce epee Debug windows are tool windows that help you debug Page 54 Building Models Incrementally ad rO se File Edit View Project Build o Gas tn fi EWA S V fg TurboTerm1 TermContract lt PlanSpec using TurboBase using System Diagnostics X namespace TurboTerml 5 public partial class amp where PlanSpec where MpSpec Tu Ge public IArray lt dou G protected virtual e if mpSpec Pr if polic retur else retur if policyYee return pr if policyMc return pr SOL Tool ap Continue Stop Debugging Detach All Terminate All Restart Attach to Process Exceptions Step Into Step Over Step Out QuickWatch Toggle Breakpoint New Breakpoint Delete All Breakpoints Disable All Breakpoints IntelliTrace Import DataTips Save Dump As Options and Settings Test Incredible Order Architecture TurboActuary Analyze Window El Breakpoints gt Ee Output FS Xx GPU Threads MED Parallel Tasks Shift F5 ES Parallel Stacks CtrleShifteF 5 Ctrl D E Fill F10 ShifteF11 Ctrl D Q FS Ctrl Shift F9 _ TurboTerm1 App Console Properties return PREM Uwe py mpopevst t eae y SEED ppap En en 1 CHa VD rval 12 8 Parallel Watch O 3w Threads Modules IntelliTrace Events IntelliTrace Calls Processes i Mad amp Memory Disassembly Registers Bf Miracle of Beauty Help Ctrl D 8 Ctri D K
18. Ctrl Shift D S Ctrl D A Ctrl D L Ctri D I Ctrl D C Ctrl D T Ctrl D M Ctri AR Y F CtritAlt Y T Ctrl D P Culs AD Ctrl D R Local Window all local variables will be listed here allowing you to get a quick overview of their name type and value You can even right click in the grid and select Edit value to give a variable a new value This allows you to test your code under other conditions than the current ones Watch Window you can use the window to explore the object values and call methods from watch window You can refer to http www codeproject com Articles 121623 10 Tips you should know about Watch Window While d Immediate Window Ctrl Alt 1 it is a great tool to increase your productivity Page 55 Building Models Incrementally Incredible Order Miracle of Beauty ET Datastructures static class TestMe Al amp H Properties i sd References public static int int x int digit A BinaryTree cs A Linkedlist cs int prod 1 A PriorityQueue cs for int i 0 i lt digit i A Program cs A Sortings cs prod 10 4 Yector cs return x prod 10 J x Value Type GetDigit 12345 Z GetDigit 12345 0 Get Digit 12345 6 GetDigit 12345 You can use the Immediate Window at design time also The cool thing is that now you re able to try out some code without firing up the debugger what a huge time saver Immedia
19. LiabilityModel lt gt Parent Class TurboTerm1 Term lt gt n ee ER a Child Classes Page 23 Building Models Incrementally Incredible Order Miracle of Beauty 3 8 Print the Whole Class Many classes consist of more than one file The file name is used as category name so you can quickly find your functions based on their categories in both Visual Studio and Excel You can color print all of these files in a class by clicking Print Current Class in TurboActuary main menu This can help you quickly understand the class We have more commands under TurboActuary menu please refer to user manual for details Page 24 Building Models Incrementally Incredible Order Miracle of Beauty Chapter 4 Turbo Intelligent In this chapter we use the original TurboTerml App sln as example In the next chapter we show how to customize TurboTerm1 App for your business You might cross read the two chapters together for deeper understanding 4 1 Highlight You can double click any word and it will highlight all words related to your selection no matter it 1s in the same file or not Nobody except us can do highlights across files public IArray lt double gt maintExpensePP get protected set protected virtual double MaintExpensePP int t double expenselnflationRatio t double premiumPP_t double sumAssuredPP_tm1 TurboAutoGenerated return maintExpensePP t planSpec FixedMaintExpensePP expenseInflation
20. Models Incrementally Incredible Order Miracle of Beauty for int 8 lt mdelPointons ows Count i MpSpec mpSpec new MpSpec globalSpec planSpec modelPointRows Rows i product planGroup plan Term term new Term globalSpec planSpec mpSpec globalSpec TotalProjectionMonths mainScenarioManager scenarioNumber true term Calculate embeddedValues i term embeddedValue bookProfits i term bookProfit _ MpSpec mpSpec new MpSpec globalSpec planSpec modelPointRows Rows i product planGroup plan Term term new Term globalSpec planSpec mpSpec globalSpec TotalProjectionMonths mainScenarioManager scenarioNumber true term Calculate embeddedValues i term embeddedValue bookProfits i term bookProfit 3 5 Dependence Tracing We can also trace precedence and dependence in VS 2012 Professional Click Turbo Dependence Tracing submenu from TurboActuary main menu dock it on the bottom of VS or float it on your secondary monitor and you will see for int i i lt modelPointRows Rows Count i MpSpec mpSpec new MpSpec globalSpec planSpec modelPointRows Rows i product planGroup plan Term term new Term globalSpec planSpec mpSpec globalSpec TotalProjectionMonths mainScenarioManager scenarioNumber true term Calculate embeddedValues i term embeddedValue bookProfits i term bookProfit Parallel For modelPointRow
21. Page 32 Building Models Incrementally Incredible Order Miracle of Beauty automatically instantly interactively and with business intelligence without reinventing a single wheel Write Once Use Everywhere Page 33 Building Models Incrementally Incredible Order Miracle of Beauty Chapter 5 Customize the Model for Your Business As we have said before you can build model incrementally Your new model will inherits and reuses your existed base model but keep the base model intact Please refer to the model TurboTerm RPR App for an example It inherits and reuses the base model TurboTerml App with the base model intact The new model TurboTerm RPR App builds risk premium reinsurance logic above the base model Here we show a simple example to add new business logics directly into TurboTerm1 App model instead of extending the base model incrementally 5 1 Add a New Assumption Table into Input File Open C TurboActuary3 0 Application Input Term TurboTerm1 TurboTerm 1 Inputs xlsb file And create an Excel assumption table with name PersistenceBonus as followings Ll F lee ce Oe dr ve fi 7T E E MR Table Tools File Home Insert Page Layout Formulas TurboActuary Turbo Cont d Data Review Wiew Developer able Mame lia Summarize with PivotTable EE f Properties Header Row _ First Colurnn e III a SS SS EEEE PersistenceBonu H Remove Duplicates Open in Browser Total Row C Last Colu
22. Parallel For modelPointRows Rows Count i gt II f 100 4 ini t double proxyDac tm1 double policies tm1 double premiumPP t v aX EE N IE e outgotnd taxOnBookProfit overheadExpensePP policies policyMonth policyYear policies premiumPP premiumPP t proxyDac Sia taxOnBookProfit 0 NaN a 1 1 01597222222222 0 99716855745822 166 666666666667 683 535144894562 2 2 02906777747318 0 994345131983307 166 666666666667 667 900962121034 3 3 03929481087011 0 991529700875397 166 666666666667 426 761658134766 Page 21 Building Models Incrementally Incredible Order Miracle of Beauty You can press F10 to step over and F11 to step into and then click refresh icon to show the most current data So you can trace and debug your model from beginning to ending of modeling process and the response time is very quick Our software is the only one that can provide the nice tool What our competitors provide is to retrieve the results from disk after your run finishes and you have to output all related data into the disk They can not debug using the data from memory during execution We debug using the data from memory during execution You do not need to output any data into disk for our debugging purpose 3 7 Turbo Navigation In addition to many navigation tools Visual Studio has provided introduced in Appendix 2 3 our Turbo Navigation tool will help you quickly find clas
23. Plan PlanSpec planSpec new PlanSpec dataAccessLayer Term1 globalSpec product planGroup plan thisRun DataTable modelPointRows ModelPointUtility GetModelPoints dataAccessLayer ModelPointTable plan TArray lt double gt Ee new Array lt double gt modelPointRows Rows Count TArray lt double gt ew Array lt double gt modelPointRows Rows Count for int 1 1 lt modelPointRows Rows Count i MpSpec mpSpec new MpSpec globalSpec planSpec modelPointRows Rows i product planGroup plan Term term new Term globalSpec planSpec mpSpec globalSpec TotalProjectionMonths mainScenarioManager scenarioNumber true term Calculate DataOutput InsertIntolable outputTable int MaxValue new ColumnContent Product product FastToString New ColumnContent Plan Group planGroup FastToStrang yo de new ColumnContent Plan plan FastToString new ColumnContent Book Profit new ColumnContent Embedded Valu IE Page 43 Building Models Incrementally Incredible Order Miracle of Beauty Here we output only bookProfits and embeddedValue You can choose to output more columns Page 44 Building Models Incrementally Incredible Order Miracle of Beauty Appendix 1 Coding Reuse Inheritance In C inheritance enables us to extend the functionality of one class to the other class that can be reused and modified accordingly The class whose members are inherited by the
24. Ratiolt planSpec MaintExpensePremiumPercent premiumPP t planSpec MaintExpenseBenefitPercent sumAssuredPP t 1 public IArray lt double gt overheadExpensePP get protected set protected virtual double OverheadExpensePP int t double expenselnflationRatio t double sumAssuredPP_tm1 TurboAutoGenerated return overheadExpensePP t planSpec FixedOverheadExpensePP expen planSpec OverheadExpenseBenefitPercent sumAssuredPP t 1 You can double click any space outside of word to underscore all arrays Page 25 Building Models Incrementally Incredible Order Miracle of Beauty public IArray lt double gt premiumPP get protected set protected virtual double PremiumPP int t int policyMonth_t int policyYear_t if mpSpec PremiumInterval IncidentIntervalEnum SinglePremium if policyYear t Value 1 amp amp policyMonth t Value 1 return premiumPP t mpSpec PremiumPP else l return premiumPP t l if policyYear t Value gt mpSpec PremiumYearTerm return premiumPP t if policyMonth t Value 1 int mpSpec PremiumInterval return premiumPP t 0 0 return premiumPP t mpSpec PremiumPP int mpSpec Premiuminterval 12 0 You can put a cursor on any symbol and it will automatically highlight all references in the current document You can navigate through the highlights by using ctrl shift down array forward or ctrl shift up array
25. Term1 App 2 Term Calculation Driver cs 17 40 public override LiabilityModel Calculate C TurboActuary3 0 Application CSharp Term Term1 TurboTerm1 App TurboTerm1 App 3 1 StatNetPremiumReserve Calculate Driver cs 17 40 public override LiabilityModel Calculate C TurboActuary3 0 Application CSharp Term Term1 TurboTerm1 App TurboTerm1 App 3 2 StatGrossPremiumReserve Calculate Driver cs 17 40 public override LiabilityModel Calculate C TurboActuary3 0 Application CSharp Term Term1 TurboTerm1 App TurboTerm1 App 3 3 TaxNetPremiumReserve Calculate Driver cs 17 40 public override LiabilityModel Calculate Call Sites Location lt term Calculate Program cs 78 26 4 Ser ee AcgExpensePP int double int int double TurboTerm1 TermContract lt PlanSpec MpSpec gt b acgExpensePP TurboTerm1 TermContract lt PlanSpec MpSpec gt Agelint double TurboBase LiabilityModel lt PlanSpec MpSpec gt age TurboBase LiabilityModel lt PlanSpec MpSpec gt BookProfit int double double TurboTerm1 Term lt PlanSpec MpSpec gt bookProfit TurboTerm1 Term lt PlanSpec MpSpec gt BookProfitBeforeTax int double double double double double double double TurboTerm1 Term lt PlanSpec bookProfitBeforeTax TurboTerm1 Term lt PlanSpec MpSpec gt Oo 9r Calendar int TurboBase LiabilityModel lt PlanSpec MpSpec gt calendar TurboBase LiabilityModel lt PlanSpec MpSpec gt Tv VY YL
26. Tools Window Help AA Gd saalo e gt gt AA Eddl SAl9 M RIG 12101dx3 uONNJOS aa 12401d 3 UONNIOS aa Recent Projects Recent IV Close p ee V Close page after project load n Page 57 Building Models Incrementally 2 6 Diff Tool Incredible Order Miracle of Beauty You can integrate external programs to perform your file merging and file diffing activities St a te ew be pys Eee pe 29 RAT e e RAMOS red are Ga Po ed re daat Court Coteet id comet JUTITA oh Jer ioe HAAR trtere it Es VO teha rts mios daal Gorea an comet DIFTITER di if pja ies war te 3 sad l Set a oper AitO imir TT sew vena fee Ta Malans OIG oo Bestel Botes N oo pestei stw MT TESTES N dT n ID God TEM Oe ED 2 7 Useful Shortcut Ctrl E D Ctrl Ctrl M O fi ijinet wr 19 Get LAS OM LAO Crewe Ed Auto format the document Open the Navigate to dialog Navigate backwards in the cursor position history Ctrl Shift Navigate forwards in the cursor position history Collapse to definitions Ctrl Shift Space To bring up the intellisense suggestions Go to Definition Shift F12 Find all references Delete current selection or current line Page 58 Building Models Incrementally Incredible Order Miracle of Beauty Ctrl Space Completes the current word in the completion list Ctrl Alt Space Suggestion mode Open Intellisense completion list Alt
27. ablesDI Con PivotTablesDP Joes PivotTablesll aS a 22 PlanGroup PlanSpec Table Engines TurboSyste 8 A E m Plan Model Point Term1_A System Dat bal X id Sis a z 2ia x fai GIE DO ujala ARE amp ty Oo a aja MI dIA T id Oz D 9 O 3 SIE IR p 3 12 x kk on 1 Term Page 41 Building Models Incrementally Incredible Order Miracle of Beauty 5 8 View Excel Model Formula C Code a To view and debug your code in Visual studio Please follow chapter 4 of Quick Start Guide TurboExcel b To view code in TurboNote Please first follow section 2 2 of this document to generate SourceCode file for the enhanced model So please click the the submenu Generate SourceCode for View C Code from Visual Studio Then follow the section 2 3 of Quick Start Guide TurboExcel Excel Table ix IJ fe TurboTerm1 App Ter Use Notepad Instead of TurboNote Copyright C 2013 TurboActuary LLC All Rights Reserved using System using System Collections Generic using System Ling using System Text using System Data using TurboSystem using TurboBase using System Diagnostics namespace TurboTerm1 public partial class TermContract lt PlanSpec MpSpec gt LiabilityModel lt PlanSpec MpSpec gt where PlanSpec TurboTerm1 PlanSpec where MpSpec TurboTerm1 MpSpec public IArray lt doub
28. ater use The I in the PivotTableIP means that row is integer type here it is a policy year the P in the PivotTableIP means that column is PlanEnum type here it is Term1_A or Term1_B The IfNoExactMatchEnum UseSpecified means that it returns the specified value 0 if no exactly matched row is found the If NoExactMatchEnum ThrowException means that it will throw an exception if no exactly matched column is found 5 3 Add Persistence Bonus Business Logic Since it is insurer s expense we go to Expense cs file of TermContract of TurboTerm1 project and add the following lines Page 35 Building Models Incrementally Incredible Order Miracle of Beauty ublie IArray lt double gt premiumReimbursePP get protected set protected virtual double PremiumReimbursePF int var pivotTable planSpec PivotTablesIP PersistenceBonus double percent pivotTablel policyYearlt Value planSpec Flan return premiumReimbursePP t premiumPPLt percent Please note that we put Nolnitialization before the function since the function need not to be executed for initial period Otherwise we can put Initialization before the function Now put the cursor in the body of the above function and click Generate Parameter for this method under TurboActuary menu It will automatically generate parameters and debug assertions for these parameters public IArray lt double premiumkeimbur
29. ccceccccccecs 34 5 1 ADD A NEW ASSUMPTION TABLE INTO INPUT FILE ese es ese es ese es ese es ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee 34 Page 111 Building Models Incrementally Incredible Order Miracle of Beauty 5 2 READ IN THE ASSUMPTION TABLE AS A PIVOT TABLE INTO PLANSPEC ccececcecccccceccacscenceceacececceceaceceaceceuceceaceceaceceaceneas 35 5 3 ADD PERSISTENCE BONUS BUSINESS LOGIC ccccccececceccccacsccacececcecenceceacecenceceaceceaceceaceceacecenceceaceeeaceceaceseaceseaceneaceneas 35 5 4 UPDATE BEGINNING CASH FLOW FUNCTION ee ese es ee es ee es ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee 36 5 5 GENERATE THE CALCULATION DRIVER in dn ie ie ee de ee eed ee ee Ge Oa A oe a ee 37 5 6 RECOMPILING AND RUNNING IN VS esse SE GREG ee Ge ed Ge Ge ER GE Ge oe Ge Ge NS GR ES oe EG DE 38 5 7 GENERA CE EXCA MODEL ie is oos es bor eb ee ee Ge De be ie ee De GE Ge 38 5 0 VIEW EXCEL MODEL FORMULA CH CODE is M see se DS Ge eg ie Ge Ge dike VR Ge we Ge ee Ge Ge De Ge ee N Ge Ge IG Go DS GE Ge 42 SI OUTPUT REULT S ia see GEE ee EE Ge ee ee Ee EE N pean ee ee Ee GE GE ieee Ge ee EE EG GE Ee OR 43 APPENDIX 1 CODING REUSE INHERITANCE ssscccccoscssccccccccssccccccscssccccccscssccccccscsscccccccsssccccccscscccccescscccccesces 45 APPENDIX 2 HOW TO USE VISUAL STUDIO sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
30. credible Order Miracle of Beauty You can investigate its dependence relationship by clicking Column Relations with active cell being AB113 ABI13 Be TurboTerm1 App Term PremiumReimbursePP this t b Policy Year Premium PP A E X ki Z AA AC AD AF 1 19 TurboTe 2 2379 2012 05 31 Comm Premium Cumulative Maint Overhead Reimburse 23 E Date PF Comm PP Expense PP Expense PP PP lg 144 2022 09 20 1140 DO 2420 09739 626 2335212 D J 0 009263 87 O A C 110 125 2042 10 21 1140 O 2420 593251 646 7093218 D D 2 O 0164839 O 3 Tip 146 2022 11 30 1140 DO 2420 785274 6256 924901 J 0 2 0 00618553 O A C Li 147 2022 12 41 1140 O 2430 62941 6456 800737 D D 2 0 004981 O 3 200 0 2 0 01806033 0 3 c Lid 129 2023 02 28 1160 0 2431 556066 647 0124081 O 0 2 O 01199627 Bea E rS 120 2023 02 21 1160 DO 2431 66974 627 710584 D O 2 0 003256734 DA C 116 121 2023 04 30 1160 DO 242371 40069 627 475602 J D 0 004798 O 3 M 4 gt M Sheet Objects fa pee i i ia o TurboX Column Relations Retresh Direct Premium Premium Reimburse Policy Year PP OUtgo Bg You can see the PremiumReimbursePP has pre dependence columns Policy Year and Premium PP and post dependence Outgo Bg Excel function wizard can tell you lots of useful information about your function calling Page 40 Building Models Incrementally Incredible Order Miracle of Beauty
31. dPP targetSurplus targetSurplusincrease baiah a ol Meal The code window always show the code related to the current center array The right box in Turbo Dependence Tracing window contains all history arrays that you have visited and let you go back quickly Page 20 Building Models Incrementally Incredible Order Miracle of Beauty 3 6 Dependence Debugging The preceding section help you navigate precedence dependence relationship between array variables and show their C codes This section shows that we can stop at any breakpoint during debugging and view its data and execution in addition to precedence dependence relationship Set up a breakpoint either outside or inside the TurboTerm1 Term class then hit F5 The program will run and pause at the breakpoint Then click Turbo Dependence Debugging submenu in TurboActuary main menu and type the name of any object having array variables for example type term if outside TurboTerm1 Term class or this if inside TurboTerm1 Term class Then you click refresh icon and will see for int 1 1 lt modelPointRows Rows Count i MpSpec mpSpec new MpSpec globalSpec planSpec modelPointRows Rows i product planGroup plan vera new Term globalSpec planSpec mpSpec globalSpec TotalProjectionMonths mainScenarioManager scenarioNumber true term Calculate embeddedValues i term embeddedValue bookProfits i term bookProfit
32. e ProjectionFromMonth B c D E F G J K L t 2 Target Required Target Surplus Polic 3 Date Surplus Surplus Increase Calendar Mon 19 2013 12 31 1000000 0 0 41639 5 20 2014 01 31 125 503261 1000000 0 0 0 2000 0 71990964 4082 88141 125 67675 41670 6 21 2014 02 28 124 358123 1000000 0 0 0 O 0 71334091 2506 08059 124 530028 41698 7 22 2014 03 31 123 223433 1000000 0 0 0 O 0 70683212 2483 26837 123 39377 41729 8 23 2014 04 30 122 099096 1000000 0 0 0 O 0 70038272 2460 6708 122 267879 41759 9 24 2014 05 31 120 985018 1000000 0 0 0 O 0 69399217 2438 2517 121 152261 41790 10 25 2014 06 30 119 881106 1000000 0 0 0 O 0 68765993 2416 03988 120 046823 41820 11 26 2014 07 31 118 787266 1000000 0 0 0 O 0 68138546 2394 02469 118 95147 41851 12 27 2014 08 31 117 703406 1000000 0 0 0 O 0 67516824 2372 23329 117 866113 41882 13 28 2014 09 30 116 629436 1000000 0 0 0 O 0 66900776 2350 613 116 790658 41912 14 29 2014 10 31 115 565266 1000000 0 0 0 O 0 66290348 2329 20007 115 725017 41943 15 30 2014 11 30 114 510805 1000000 0 0 0 O 0 6568549 2307 96489 114 669098 41973 16 31 2014 12 31 113 465966 1000000 0 o o O 0 65086151 2286 95788 113 622815 42004 This is a full fledged model As we have shown it is well organized and extremely traceable Inside and out you can play your actuarial models in Excel at any modeling level
33. e TurboActuary Analyze Window Help P Start Debug j Classl ccs 4 X v Solution Explorer Pemyristiubocesscast SO OP OM Ol Oe BE using System F ae lor m using System Collections Generic a eee using System Ling amp Solution MyFirstTurboClass 1 project using System Text 4 MyFirstTurboClass using System Threading Tasks D Properties gt References namespace MyFirstTurboClass b Classics E public class Class1 l Please write several functions inside the class It should look like Page 5 Building Models Incrementally Incredible Order Miracle of Beauty fg MyFirstTurboClass Class1 T ThisYearValue double interestRate using System using System Collections Generic using System Lina using System Text using System Threading Tasks namespace MyFirstTurboClass public class Class1 private double lastYearValue public Class1 double lastYearValue this lastYearValue lastYearValue public static string Hello return Hello Actuary E public double ThisYearValue double interestRate return lastYearValue 1 6 interestRate In the Solution Explore double click the Properties then go to Build Event click Edit Post build and put the one copy command inside the input box C TurboActuary3 0 bin System TurboPostEvent TargetDir TARGETNAME Configuration It should look l
34. e ses SEE Me ke see dee ve ee ee tun se ke Ge ee ke ee ee We Ge ee ie Se eb ee ee Re 13 3 3 TRACE MAIN FUNCTION EXECUTION sesse ee ie see EG ee ee Ge ee ee GE ee Ge Re ee Ge GE NG ol ee ie Ge Ee Ge Ge se 14 3 4 HIGH PERFORMANCE IN MULTI CPU CORE COMPUTERS ee ees sees ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee 18 32 DEPENDENCE TRACING es ee SR ee GR EG Re NE EE ee ee ee RE GEE EE EE 19 3 6 DEPENDENCE DEBUGGING ee ee es ee es ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee 21 oa sed N le DOIN ER RR RE N OR N EE N 22 AB PET TE WY HOIE CIA Se GE EE GERIG ER EG EG GR OG EE ee ER GO EE ER EG GE GE GE RE EG Ge DE ie ee ed 24 CHAPTER 4 TURBO INTELLIGENT esse sesse ike de Ge oe ged de ii ek GR Ges Ge ed De Ge Oe Ee de be eb GR Ge Ge De Ge Oe ee de be kk GR Ge Ge ed 25 Rd ie DI el RA Gare ph oc eres EO OER EE HE EE ER NE E N Ed 25 4 2 AUTO GENERATE PARAMETERS kos ek se ed ee GR oi se SG Gee stud Se ed Ge Ge Ge Gere Ge Ge Ge ee Ge oe Ge SG Ge ne Ge Ee Ge See ee osa 27 4 3 AUTO GENERATE CALCULATION DRIVER ese ee ee ee ee ese ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee 27 AA AUTO GENERATE EXCEL MODEL i e EE SE n es SR ee ee nausea EG ee Ge GR SG GE Ge Ee Ge ER ee ee N Ge EG RE Ge Re ee 31 CHAPTER 5 CUSTOMIZE THE MODEL FOR YOUR BUSINESS ccceccecccccccccccccccccccccccccccccccccccccccccc
35. earValue MyFirstTurboClass Class ThisYearValue D4 C6 The three formulas will have results like Page 8 Building Models Incrementally Incredible Order Miracle of Beauty D6 7 fe MyFirstTurboClass Class1 ThisYearValue D4 C6 CE co p E F Ca TurboX Navigator Hello Actuary Class 1c MyFirstT urboClass Class1 100 MyFirstTurboClass Class1 15 Book1 Sheet1SD 4 PEER TurboAsset BV FixedBondOption 0 05 105 TurboAsset BV FloatingBond a TurboAsset BV InArrearFloatingBond TurboAsset CashFlow Now you should have some sense how easily you can write your high performance building blocks which can be shared by both platform model and Excel model 2 2 View C Code From Excel You can use Visual Studio to view and debug the C codes when you are working in Excel as we have discussed in the chapter 4 of Quick Start Guide TurboExcel Alternatively you can use TurboNote or Notepad to view C codes when you are working in Excel as we discussed in the section 2 3 However this requires you or somebody else has done the followings 1 Generate SourceCode file in Visual Studio Remember the path and name of the generated file that will be used in step 2 Page 9 Building Models Incrementally Incredible Order Miracle of Beauty TurboActuary Analyze Window Help VSNETcodePrint P Generate Parameters for this Method Fm a r Generate Parameters for this class C Auto Complete Arguments
36. el ss sl Ss SIOODGHAGEADER TurboTerm1 TermContract lt PlanSpec MpSpec gt public IArray lt double gt claimExpense 1 get protected protected virtual double ClaimExpense int t double we ny i 4 Jo10Jdx3 Jaa Ss B T TurboAutoGenerated XOOJOOL N double maturityExpense 0 0 double deathExpense planSpec FixedDeathExpens if t mpSpec MaturityMonth maturityExpense planSpec FixedMaturityExp return claimExpense t deathExpense lapseEx public IArray lt double gt maintExpensePP get protect protected virtual double MaintExpensePP int t doub TurboAutoGenerated return maintExpensePPlt planSpec FixedMaintE planSpec MaintExpensePremiumPercent pre planSpec MaintExpenseBenefitPercent sum double lapseExpense planSpec FixedLapseExpens Project Build Debug Team Data Tools Test TurboActuary Analyze Window Help VSNETcodePrint e Parameters for this Method Generate Parameters for this class C Auto Complete Arguments F Auto Generate Calculation Driver Code I Auto Generate IArray Allocation Code From this Calculation Driver X Auto Generate Excel Formulas From this Calculation Driver S Sort Selected Statements M Find Unused Members in this Solution of this Class U Toggle Upper Lower Case O Auto Format cs Files of this Class G Insert Using Generics A Align Selected Statements R Expa
37. gt bookProfits new IArray lt double gt modelPointRows Rows Count for int 1 6 1 lt modelPointRows Rows Count 1 MpSpec mi new lpSpec globalSpec planSpec modelPointRows Rows 1 product planGroup plan The following codes calculate embedded values and store results into output TurboTerm1 csv These codes are parallel to Term tab in Excel application we introduced in chapter 2 of Quick Study Guide TurboExcel Page 17 Building Models Incrementally Incredible Order Miracle of Beauty for int 1 6 1 modelPointRows Rows Count 1 pSpec mpSpec new MpSpec globalSpec planSpec modelPointRows Rows 1 product planGroup plan ee new Term globalSpec planSpec mpSpec 9 globalSpec TotalProjectionMonths mainScenarioManager scenarioNumber true Gsta0vtput dnsertintoToble output Tab Q int MaxValue new ColumnContent Product product ToString new ColumnContent Plan Group planGroup ToString new ColumnContent Plan plan ToString new ColumnContent Book Profit bookProfits Sum new ColumnContent Embedded Value embeddedValues Sum 3 4 High Performance in Multi cpu core Computers The codes in the above section have only made used of one core of your computer Our software is very easy to do parallel computing in multi cpu core computers You only have to change your for loop to be Parallel For loop Page 18 Building
38. he Auto Generate Excel Formula From Calculation Driver submenu Click OK then xCopy Now you go back to the opened Excel workbook you will see it auto generates a new tab with Excel table AB AC AD Comm Comm Maint Overhead Expense PP Expense PP Cumulative PP Charge Back PP O 1900 01 31 Et reference n l System NullReferenceException Object reference not set to an instance of an object Date Comm PP AE AF 1 1900 02 28 1 TurboX Tur TurboX Tur TurboX Tur TurboX Tur TurboX Tur 1 TurboX Tur TurboX Tur 1 System Nul TurboX Tur 1 System Nul Total Now put some assumptions into the new sheet Al Models Projection From Month A2 Models Projection To Month B1 Models Term B2 GlobalObjects The Present Date Then in cell B1 click Object Format in Turbo Cont d ribbon menu to format the cell Then activate any cell in the Excel table say A4 and click Auto R in TurboActuary ribbon menu you will automatically generate your Excel model successfully To quickly find the PremiumReimbursePP you can click the Columns and Categories to locate it NEE ome Insert Page Layout Formulas TurboActuary Turbo Cont d Data Review View Developer a Go P Direct lt lt Direct vi E Insert Table Total Row j f G GE P All at All T Resize Si Spark Me ZA Import n Root Excel Row Column Name and Addin View Source Code Visualizer Turbo Help
39. ike Page 6 Building Models Incrementally Incredible Order Miracle of Beauty ZA Exercisel ce Ti Exercise Console Ga Program cs r Solution Explorer em RN ry Bs e e Application fod Solution Exercisel 2 pi p Exercise Console Build Build Events Hg Debug a References Problems cs Resources Services Edit Pre build Settings Reference Paths CA TurboActuary3 0 bin System TurboPostEvent Tar lt Signing Code Analysis CATurbo ctuary3 0 bin System TurboPostEvent TargetDir TARGETNAME Configuration Click OK Then Save the solution Then press F6 or click Build Solution submenu under Build menu to compile and build the solution in debug mode Correct any typing error if build not succeed override A oblerms cs ise L PF ro kiaiii DUFIe strike de publice static double CallPrice double spot double strike double volatility double r i double a Math Log spot strike double b_call G 0 5 Math Pow wolatility 23 t double h put tr 0 5 Math Powfvolatility 2 t double c volatility Math Sqrt t double d1 ta b_eall c double d2 fa b_put f c CumulativeNormalDistribution cumulativeNormalDistribution new CumulativeNormalDistributien G double Price spot cumulativeNormalDistribution Value d1 strike Math Exp r t eumulativeNormalDistribu
40. le gt premiumReimbursePP get protected set Nolnitialization 1 proteeteavirualdodble PremiumRelmbursePPint ing poleyVesr double premiumPP t region TurboAutoGenerated TurboDebug Assert policyYear policyYear_t t TurboDebug Assert premiumPP premiumPP t t endregion TurboAutoGenerated var pivotTable planSpec PivotTablesIP PersistenceBonus double percent pivotTable policyYear t Value planSpec Plan return premiumReimbursePP t premiumPP t percent OOO E O a oOo e oOo e oOo Page 42 Building Models Incrementally Incredible Order Miracle of Beauty 5 9 Output Results In the Visual Studio model platform model you can output your results to csv file or database Sql Server Oracle etc In the Main function of Program cs you can specify what you want to output DataTable outputTable DataQutput CreateTable new ColumnSpec Product typeof string new ColumnSpec Plan Group typeof string new ColumnSpec Plan typeof string Book Profit Embedded Value Default type is double foreach DataRow planRow in planToRun AsEnumerable ProductEnum product Utility ToEnum lt ProductEnum gt planRow Field lt string gt Product PlanGroupEnum planGroup Utility ToEnum lt P lanGroupEnum gt planRow Field lt string gt Plan Group PlanEnum plan Utility ToEnum lt PlanEnum gt planRow Field lt string gt
41. leArray ProjectionFromMonth ProjectionToMonth endregion Benefit Summary region Capital reguiredSurplus n Ldi leArray ProjectionFromMonth ProjectionToMonth targetSurplus new ProjectionFromMonth ProjectionToMonth targetSurplusIncrease new SoloSlidingDoubleArray ProjectionFromMonth ProjectionToMonth endregion Capital CashFlow region Control and Time calendar new SoloSlidingArray lt System DateTime gt ProjectionFromMonth ProjectionToMonth policyMonth new SoloSlidingArray lt int gt ProjectionFromMonth ProjectionToMonth policyYear new SoloSlidingArray lt int gt ProjectionFromMonth ProjectionToMonth endregion Control and Time region Demographics age new DuetSlidingDoubleArray ProjectionFromMonth ProjectionToMonth death new SoloSlidingDoubleArray ProjectionFromMonth ProjectionToMonth deathRate new DuetSlidingDoubleArray ProjectionFromMonth ProjectionToMonth lapse new SoloSlidingDoubleArray ProjectionFromMonth ProjectionToMonth lapseRate new SoloSlidingDoubleArray ProjectionFromMonth ProjectionToMonth policies new rojectionFromMonth ProjectionToMonth endregion Demographics The Simple Array will allocate memory for all projection months However the Solo Sliding Array will allocate only one element and keep rolling with your projection the Duet Sliding Array will allocate only two elements and keep rolling with your projection Our intelligent tool will au
42. lick Update After update start VS2012 and go to Tools menu then Environment then General and choose blue in the color theme Visual experience Color theme Add in Security Blue AutoRecover L Automatically adjust visual experience based on client performance Documents ees l l ch visual experie Extensions and Updates Enable rich client vi ad Ee Find and Replace Use hardware graphics acceleration if available 4 2 Indent Guides Optional It adds vertical lines at each indent level in Visual Studio 2010 2012 as Page 61 Building Models Incrementally Incredible Order Miracle of Beauty public virtual double GmabMoneyness int t double avPP_t double gmabPP_t double gmabPresentValuePP_t if mpSpec GmabIndicator j return gmabMoneyness t 0 0 switch planSpec GmabMoneynessDefinition case MoneynessDefinition GuaranteeLumpSum if avPP t EpisionLarger return gmabMoneyness t gmabPP t avPP t else il return gmabMoneyness t 1000 0 or any large number ase MoneynessDefinition GuaranteePresentValue if avPP t EpisionLarger return gmabMoneyness t gmabPresentValuePP t avPP t else g return gmabMoneyness t 1000 0 or any large number default throw new Exception error It 1S free and can be downloaded from http visualstudiogallery msdn microsoft com e792686d 542b 474a 8c55 630980e72c30 After installation start VS 2012 and go to Too
43. lp oo Categories Tables Aways Relations Names Professional File Samples n n a gt AC ALACO gt a OLIE AILE gt VVC rd Name Manage Cer ee oee Name Refers To Comment LE ProjectionFromMonth StatNetPre LE ProjectionFromMonth Term A 1 ProjectionToMonth StatGrossP ProjectionToMonth StatNetPre LE ProjectionToMonth Term A 2 C TurboActuary3 0 Application CSharp Term Term1 TurboTerm1 App T C Turbo nn 19 2013 12 31 1000000 0 0 43 58333333 1 StatGrossP E Table5 19 2013 12 31 1000000 0 0 rn 41639 0 0 43 5 Term A 4 E Table7 19 2013 12 31 1000000 0 0 43 58333333 1 0 2 StatNetPre thePresentDate 2012 05 31 StatGrossP thePresentDate 2012 05 31 StatNetPre Page 11 Building Models Incrementally Incredible Order Miracle of Beauty Chapter 3 Platform Models 3 1 Hierarchical Architecture The library codes are under C TurboActuary3 0 Liability while the application codes are under C TurboActuary3 0 Application CSharp These applications are built on top of these libraries The application layer inherits the codes of library layer so it is reuse not rewrite A good example of inheritance can be found in the Appendix 1 Go to C TurboActuary3 0 Application CSharp Term Term1 TurboTerml App
44. ls menu then Options submenu find Indent Guides and set as the following picture Task List Content Type Default 7 CSharp Web Browser gt Projects and Solutions EET Highlight Color _ NavajoWhite Source Control Unaligned Highlight Style Solid Text Editor 1 Line Color P Gray Debugging 2 Line Style Solid IntelliTrace 3 Visible True Performance Tools E ii Database Tools 6 F Tools 7 HTML Designer 8 4 Indent Guides 9 Appearance 10 B Behavior 11 Office Tools 12 Page 62
45. m EamingDistributinglnterval Quarterly embeddedValveDiscountRate 0 125 FiscalYearEndingMonth 12 int scenarioNumber py MyfirstRun 4 scenarioManagerFactory amp TurboSystem ScenarioManagerFactory lt TurboBase IndexEnum TurboBase InterestCurveEnum TurboBase VolatilitySurfaceEnum gt DataTable planTORU pcumAccuredPUl 1000 0 E ThePresentDate 5 31 2012 12 00 00 AM DataTable outputTa TotalProjectionMonths 4800 new ColumnSpe Trouble Shooting if the Visualizer magnifying glass does not work please refer to the Appendix 3 2 Trouble Shooting in Visual Studio Side in the first start guide book to make the Visualizer work Clicking the magnifying glass you will get ad TurboBase GlobalSpec Copyright C 2012 TurboActuary LLC Ed Name Value __ CorporateTaxRate Earning DistributingInterval FiscalYearEndingMonth Run MyFirstRun 5 31 2012 12 00 00 AM 6 TotalProjectionMonths embeddedValueDiscountRate 0125 scenarioManagerFactory And you can click to view nested data The following codes read inputs from TurboTerm1 Input xlsb and process assumptions into global spec plan spec and model point spec They also prepare output table for outputs These codes are parallel to Objects tab in Excel application we introduced in section 3 1 of Quick Start Guide TurboExcel Page 16 Building Models Incrementally Incredible Order Miracle of Beauty string excelFileNameOrDatabaseConnec
46. mn EEEE EEEEE Export Refresh l SES BEA T Resizelfable lt i Convert to Range e 25 Unlink Banded Rows Banded Columns Propertie Tools External Table Data 4 Table Style Options SA 20 E WF H J K L Fersistence Bonus Terml_ A ermi1 B Le Of 0 12 5 2 0 2 double double al Please refer to Appendix 1 2 of Quick Start Guide TurboExcel for how to create an Excel table for assumption use Page 34 Building Models Incrementally Incredible Order Miracle of Beauty 5 2 Read in the Assumption table as a Pivot Table into PlanSpec Go to App PlanSpec cs in the project TurboTerm1 App of the solution TurboTerm1 App Add the highlight lines public PlanSpec DataAccessLayer dataAecessLayer string planSpecName GlobalSpec globalSpec ProductEnum product PlanGroupEnum planGroup PlanEnum plan RunEnum thisRun default RunEnum base planSpecName globalSpec product planGroup plan region TableSet this Tables Add Plan dataAccessLayer Read Plan Run 10 WithtthisRun nulli Plan Table this InsuranceTableEngines Add datadceessLayer MortalityTables globalSpec Run plan Mortality wf a this PivotTablesIP Add SumAssuredIndex datadecessLayer Read lt int PlanEnum SumAssuredIndex IfNoExzactMatchEnum UsePriorOne IfNoExactMatchEnum ThrowException This line of code will read the PersistencceBonus table from Excel input file for l
47. n TurboAutoGbenerated return outgoBglt taxOQnPremiumPP t commPP t ExpenseFF t maintExpensePP t overheadBxpenseP BE plaashuise EED policieslt 1 ae 5 5 Generate the Calculation Driver Go to Calculation Driver cs of folder term of project TurboTerm1 App 1 Delete the function ArrayAllocation 2 Put the cursor inside the function Calculate and click the Auto Generate Calculation Driver Code submenu Choose Pick to generate the calculation driver for the picked column Embedded Value EmbeddedValue distributableEarning Pick return this 3 Put the cursor inside the function Calculate and click the Auto Generate Array Allocation Code submenu Please rename the generated function as 6 ArrayAllocations Now please repeat the above three steps for the Calculation Driver cs of folder StatGrossPremiumReserve of project TurboTerm1 App Page 37 Building Models Incrementally Incredible Order Miracle of Beauty 5 6 Recompiling and Running in VS Rebuild solution in Debug configuration hit F5 to run it You can debug it by setting breakponts Please refer to section 3 3 for the execution tracing oft Visual Studio Choose Debug from the Build Debug Team Tools Art Dropdown textbox DTe e sun ra JA ta De oll Ra ml protected virtual double PremiumfeimbursePP int t int policyYear region TurboAutoGenerated TurboDebue Assert
48. n error for testing purpose Project Build Order Invest Category cs Invest Income cs Profit cs Rate cs Reserve cs Tax Reserve cs Taxes 3 1 NetPremiumReserve 3 2 GrossPremiumReserve string excelFileNameOrDatabaseConnectionString Utility BuildConnectionString Add Add Reference string excelFileNameOrDatabaseConnectionString Utility Env TurboRoot Apg eur esel Add Service Reference TurboTermlinputs xlsx Manage NuGet Packages 43 View Class Diagram DateAccesslayer dataAccessLayer new DataAccessLayer excelFileNameOrDatabaseConr 0 RunEnum thisRun RunEnum MyFirstRun Add Solution to Source Control GlobalSpec globalSpec new GlobalSpec thisRun dataAccessLayer GlobalSpec H Cut Ctrlex InterestCurveDefinition VolatilitySurfaceDefinition 1 Specs and Enum App MpSpec cs Paste Ctrl App PlanSpeccs ScenarioMianagerFactory scenarioManagerFactory globalSpec scenarioManagerFactory X Remove Del 2 Term ScenarioManager mainScenarioManager scenarioManagerFactory GetMainScenariomManag gt Rename Calculation Driver cs Unload Project Constructor cs 3 1 StatNetPremiumReserve int scenarioNumber 1 C Open Folder in File Explorer 3 2 StatGrossPremiumReserve 3 TaxNetPremiumReserve DataTable planToRun dataAccessLayer Read PlanToRun Run With thisR A Properties DataTable outputTable DataQutpu
49. nd or Collapse all Regions in the file W Toggle Long Line Wrap Print Current Class Print Current File H Turbo Tagging Highlight T Turbo Dependency Tracing D Turbo Dependency Debugging N Turbo Navigator Enable View C Code in Visual Studio when Working in Excel Generate SourceCode for Viewing C Code in TurboNote when Working in Excel Page 3 Building Models Incrementally Incredible Order Miracle of Beauty Chapter 2 Create your own Excel functions Before we show you our platform models we would like to show you first how easily you can create your own c functions Please note that any function you created can be used by both platform models and Excel models without any extra work Platform _ Models MAA wa for Performance For those people who are not familiar with C C is the most popular language in windows platform and please refer to Appendix 3 for more detail The exercise in this chapter is similar as a the solution under C TurboActuary3 0 Application CSharp Exercise Exercise b Exerice xlsb under C TurboActuary3 0 Application Excel Math 2 1 Writing Once and Use Everywhere Now open Visual Studio choose New Project then C then Class Library and type MyFirstTurboClass and click OK It will look like Page 4 Building Models Incrementally Incredible Order Miracle of Beauty Start Page Microsoft Visual Studio Quick Launch Ctrl Q Edit View Debug Team SQL
50. rt Wit i leFs fg TurboTerm1 TermContract cPlan oe Start Performance Analysis Alt F2 Thus wel BR Start Perfor s Analysis P j Ctrls Alt F2 t 1 to enforce the time sequence int polici is k double sui return sui Exceptions Ctrl D E G public IArray G lt summary gt The death evious month multiplied by the number of death gt summar Ctrl Shift F9 protected vir double policies_tm1 double sumAssuredPP_tm1 Bz TurboAutoj IntelliTrace return de Gear All DataTips deathRate t Export Datalips Import DataTips Options and Settings TurboTerm1 App Console Properties Page 53 Building Models Incrementally Incredible Order Miracle of Beauty Conditional breakpoint allows you to set specific conditions that have to be met for a breakpoint to freeze execution You have the choice between several types of conditions like the value of a variable or the number of iterations over a specific breakpoint required before execution stops var cars e new List lt string gt Mitsubishi Subaru Audi foreach var car in cars Delete Breakpoint IS Disable Breakpoint Ctris F9 Location Hit Count Select Condition which will open up the following dialog box Breakpoint Condition y be When the breakpoint location is reached the expression is evaluated and the breakpoint is hit only if the expression is true or has changed
51. s Rows Count i gt H4 Turbo Dependency Tracing AX TurboTerm1 App StatGrossPremiumReserve TurboTerm1App StatNetPremiumReserve TurboTerm1LApp TaxNetPremiumReserve TurboTerm1 App Term TurboTerm1 GrossPremiumReserve T TurboTerm1 Te lt gt Page 19 Building Models Incrementally Incredible Order Miracle of Beauty Choose TurboTerm1 Term lt gt and you will see rotected virtual double ProxyDa int t double proxyDac_tm1 double policies tm1 double premiumPP_t TurboManualGenerated refer page 464 of Atkinson F The first part amount related to premiums after globalSpec thePresentDate The second part amount related to premiums before globalSpec thePresentDate return proxyDac t firstPart secondPart ProxyDaclidt t double proxyDac tm1 double policies tm1 double premiumPP t die EE ee policies polides amp taxOnBookProfit premiumPP policyMonth policyYear Fe statReserve statReservelncrease statReservePP sumAssuredPP tarnatGurnliic As always the blue color means precedence and green color means dependence You can double click any of these array names similar as Excel column or quickly search by ProxyDac int t double proxyDac_tm1 double policies tm1 double premiumPP t TurbotemLfem lt gt 4 k polides premiumPP proxyDac requiredSurplus statReserve statReservelncrease statReservePP sumAssure
52. sePP get protected set NoInitialization protected virtual double PremiumReimbursePP int t int policyYear_t double premiunPP_t policyYear policyYear_t t premiumPP premiumFF_t t var pivotTable double pereent planSpec PivotTablesIP PersistenceBonus pivotTablelpolicyYear t Value planSpec Plan return premiumReimbursePP t premiumPPLt percent 5 4 Update Beginning Cash Flow Function In the CashFlow cs of project TurboTerm1 we are going to update the OutgoBg function so that it incorporates the premiumReimbursePP item and then redo the Generate Parameter for this method under TurboActuary menu Page 36 Building Models Incrementally Incredible Order Miracle of Beauty publie IArray lt double gt outgoBg get protected set protected virtual double OutgoBg int t double acgEzpensePP t double commPP t double maintExpenseFF_t double overheadExpensePP_t double policies_tml double premiumReimbursePP t double tazOnPremiumPP t region TurboAutoGenerated TurboDebug Assert acgExpensePP acgEzpensePP t t l commPF commPF t t maintExpensePP maintEzpenseFP_t t TurboDebug Assert Turbollehug Assert EA ER TurboDebug Assert overheadExpensePP overheadExpensePF t t TurboDebug Assert policies policies tml t 1 TurboDebug Assert oventaaburs premiumReimbursePP_t t TurboDebug Assert tax0nPremiumPP taxQnPremiumPF_t t endregio
53. ses functions and data fields Click Turbo Navigator in TurboActuary main menu you will get Page 22 Building Models Incrementally Incredible Order Miracle of Beauty Edit View Refactor Project Build Debug Team Data Tools rd d x aala Ad gt Debug System Diagnostics Debugge dF Gb 6 Ls a Ife S2 0OSGugdaQ Mi AppPlanSpec cs 4 Constructor cs Test TurboActuary Analyze Window Help VSNETcodePrint i t t gt gt Turbo Code Navigator mm H Reserve cs TurboTermLTerm lt PlanSpec MpSpec gt 1 StatReservePPtint t 7 4 Toggle between current class or current file using TETEL COLLECTIONS VEICI TES us AcqExpensePP int t double expenselnflationRatio_tm1 int Agetint t double age_tm1 BookProfittint t double bookProfitBeforeT ax t double tax BookProfitBeforeTax int t double incomeBo_t double inco Calendar int t ChargeableCapitalGainProportion int t System DateTime ChargeableCapitalGainReturnint t ClaimExpense int t double death t double lapse_t double CommChargeBackPPiint t double commCumulativePP_t in r CommCumulativePPiint t double commCumulativePP_tm1 4 CommPPiint t int policyYear_t double premiumPP_t Deathiint t double deathRate_t double policies_tm1 DeathBenefit int t double deathRate_t double policies_tm DeathRate int t double age_tm1 double deathRate tml ir DistributableEarning int t do
54. ssssssssssssssssssssooo 46 2 OUE ELAINE NNS SOMS es ie EEE ee aac N Ge De GE ee sec De ee ee es ed 46 27 INMELIISEINS cased cate ko oe anak ee Re Ge Ge eo onde ek GE EG OR GE RE RE GE GE Ge ee Ge Ge ee 46 2 3 CODING NAVIGATION i s esse ee ee SE SR Ee ER RE n Re ee Se GE ee ee GR ee ee ee ee 48 24 DEEG I aE EET AAE OAE Ge EE EE AR GE Ee 53 2 3 DOCKING WINDOW AE ER OR OT OO EE EN 57 2 DIEF TOELAE cidade sania Ee ee Ee ei Ee creo hers Oe Ee EE ane Ee ee ee Ee ee 58 DF ASS EEO HORTEET oe ie oe ONE A ER Ge GR Ge OE cane OE EG EG ee Ge De EG No 58 APPEND SI ABOUT CE sicaciansesnciersnsatteraivnnicisecestaveesnaievansadneroivedieiseusataraesucievensedneroipenieiseveataveesecievansasneroivenieiseusaas 60 APPENDIX 4 VISUAL STUDIO TOOLS cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccceccccccecccccseccceccosccecccs 61 A 1 BLUE THEME OPTIONAL RE EO RE EE EE EE OE EE EE 61 4 2 INDENT GUIDES OPTIONAL ccccccsssecccccessscecccensecesseesecesseuneecesseueecesseeusecesseuneecesseuneesesseeneesesseunsecesseenesesseuneesesss 61 Page iv Building Models Incrementally Incredible Order Miracle of Beauty Chapter 1 Installation Please read Quick Study Guide TurboExcel first If you run into problems please read Appendix 3 of Quick Study Guide TurboExcel 1 1 Installation of Visual Studio 2010 2012 2013 You can install VS 2010 2012 2013 Professional or above They are 90 days free at http www microsof
55. t CreateTable new ColumnSpec Product typeof string new ColumnSpec Plan Group typeof string new ColumnSpec Plan typeof string Baal Aandi e Cabaddad iatna Ns gt se References App confi Double click Program cs Set a breakpoint at the beginning of Main function Then click Start or hit F5 to run it in debug mode o BOME 9 esl fie fi DER AA App config TurboTerm1 App Console Program cs X DALER t TurboTerm1 App Console Program ER Main string args 7 l2101d 3 1aAMas string excelFileNameOrDatabaseConnectionString Utility Env TurboRoot Application Input Term TurboTerm1 TurboTermiInputs xlsx O Press F10 to step over F11 to step into shift F11 to step out To view data you can hover over the variable name to click the expand icon or magnifying glass icon as following GlobalSpec new GlobalSpec thisRun dataAccessLayer GlobalSpec Historical NestedNodes InterestCurve VolatilitySu TurboBase GlobalSpec rioManager Page 15 Building Models Incrementally Incredible Order Miracle of Beauty GlobalSpec balSpec thisRun dataAccessLayer GlobalSpec Historical NestedNodes InterestCurveDefinition VolatilitySig globalSpec 9 lurboBase GlobalSp de base TurboSystem Visualizable amp TurboBase GlobalSpec ScenarioManagerFac CorporateTaxRate 0 35 ScenarioManager
56. t com visualstudio eng downloads Your company can purchase VS 2012 Professional much cheaper than its retail price US 499 without MSDN subscription by using volume licensing sales channel 1 2 Unblock DLL Unblock these files in C TurboActuary3 0 bin System after righ click and choose propertis 4 TurboVisualizer2010 dll Properties be Local Di General Digtal Signatures kem Burn New folder Name i E Turbo Visualizer2010 dl Ti Turbolntellisense Type of file Application extension dll TurboPostEvent Opens with Unknown application ee TurboSystem Dongle dill Location C Turbo ctuary 3 0 bin System 2 TurboSystem Dongle64 dll_ Size 197 KB 202 560 bytes hel Size on disk 200 KB 204 800 bytes 5 TurboVisualizer2013 dll _ Created Yesterday August 31 2014 11 29 43 PM Modified Yesterday August 31 2014 11 28 47 PM Yesterday August 21 2014 11 28 43 PM Attributes E Read only O Hidden cD Securty This file came from another Unblock computer and might be blocked to help protect this computer Page 1 Building Models Incrementally Incredible Order Miracle of Beauty 1 3 TurboVisualizer and TurbolIntellisense Installation a For VS 2010 copy C TurboActuary3 0 bin S ystem Turbo Visualizer2010 dll to My Documents Visual Studio 2010 Visualizers b For VS 2012 2013 do similar as a c Double Click to open and install TurboIntellisense vsix in C TurboActuary3 0 bin Sys
57. ta Review View Developer Design amp O El LO T L i B Cut Calibri llv A ag B Y E Wrap Text General v a GF oe of vil aa AT 53 Copy Fill 7 Paste BIU oa SF F f Meroe amp Center zY 9 40 0 Conditional Format Cell Insert Delete Format e Sort amp Find amp J Format Painter ONE 2 es AA er AS i else Formatting 7 as Table Styles v oe Filter Select Clipboard p Font E Alignment fx Number F Styles Cells Editing ca z fe A B C D F G is K Lo M N O P Target Required Target Surplus Policy 3 i Date Surplus Surplus Increase Calendar Month Policy Year 4 O 1900 01 31 1 System Nul TurboX Tur TurboX TurboXException Inappropriate Data Type 2 l System Nul System Nul System Nul System NullReferen 5 1 1900 02 28 TurboX Tur System Nul TurboX Tur TurboX Tur TurboX Tur TurboX Tur TurboX Tur TurboX Tur TurboX Tur System Nul System Nul System Nul TurboX Tur Turbo 6 Total a Now put some assumptions into the new sheet cell Al Models Projection From Month cell A2 Models Projection To Month cell Bl Models Term and cell B2 GlobalObjects The Present Date Then in cell B1 click Object Format in Turbo Contd ribbon menu to format the cell Then activate any cell in the Excel table say A4 and click Auto R in TurboActuary ribbon menu you will automatically generate your Excel model successfully vG F
58. te Window int 2 a j 2 double v System Math Pow 9 8 J 51 0 vw 51 0 Call Stack Ctrl Alt c from the call stack window you can find who is calling the function and cascade down to the main function It is a great debugging tool Page 56 Building Models Incrementally Incredible Order Miracle of Beauty protected virtual double PremiumPP int t int policyMonth_t int policyYear_t TurboAutoGenerated if mpSpec PremiumInterval IncidentIntervalEnum SinglePremium if policyYear t Value 1 amp amp policyMonth t Value 1 return premiumPP t mpSpec PremiumPP else return premiumPP t H return premiumPP t 6 6 im 8 TurboTerm1 dll TurboTerm1 TermContract lt TurboTerm1 App PlanSpec TurboTerm1 App MpSpec gt PremiumPP int t int policyMonth_t int policyYear Line 33 TurboTerm1 App dll TurboTerm1 App Ter ine 68 Oxf6 bytes TurboTerm1 App Console exe TurboTerm1 App e Program Main string args Line 78 0x18 bytes External Code 2 5 Docking Window Visual Studio allows developers to move resize and pin these windows edit window toolbox windows solution explorer windows etc inside Visual Studio s top level window or to float them and move them anywhere on the desktop including to a secondary monitor Please refer to http www functionx com csharp LessonO1 htm File Edit View Debug Tools Window Help File Edit View Debug
59. tem you might need to select Microsoft Visual Studio Version Selector to open it Trouble Shooting If visualizers subfold does not exist then create it and do a and b Trouble Shooting if you have installed Turbolntellisense vsix before you need to uninstall it first and then reinstall To uninstall it choose Extensions and Updates submenu in in tools menu and then choose TurboIntelliSense and uninstall dj TurboTerm1 App Microsoft Visual Studio File Edit View Project Build Debug Team SQL Tools Test Architecture TurboActuary Analyze Win E7 Extensions and Updates Sort by S K Indent Guides i Controls Adds vertical lines at each indent level Samples i Templates O Microsoft Web Developer Tools SDKs P Provides the latest Web Developer Tools for ASP NET Tools b Online NuGet Package Manager A collection of tools to automate the process of downloading installing b Updates 2 upgrading configuring and removing packages from a VS Project Productivity Power Tools A set of extensions to Visual Studio Professional and above which improves developer productivity Disable Information about my package Page 2 Building Models Incrementally Incredible Order Miracle of Beauty If you open Visual Studio and you will see TurboActury main menu and submenus TurboTerm1 App Microsoft Visual Studie File Edit View Refactor AA SAAK AA A AIP OR By f
60. tion Value id return Price Page 7 Building Models Incrementally Incredible Order Miracle of Beauty Trouble Shooting if VS complains that the TurboPostEvent fails close all Excel books Then restart Visual Studio and retry Now you have finished our first library with 3 functions inside 1 class You are going to use them in Excel Use Notepad or Notepad to open C TurboActuary3 0 TurboX TurboX xml Insert lt ExternalLibrary Path C TurboActuary3 0 bin TurboX Debug MyFirstTurboClass dll gt into TurboX xml and it should look like Fi C TurboActuary3 0 TurboX TurboX xml Notepad ET EE ee ee File Edit Search View Encoding Language Settings Macro Run Plugins Window CARS eels ADO C e e Rl ale M Aal aI VROEG a d Turboxxm lt ExternalLibrary Path C TurboActuary3 0 bin TurboxXDebug MyFirstTurboClass dl1 gt lt ExternalLibrary Path C TurboActuary3 0 bin TurboxXDebug Exercisel dl1 gt lt ExternalLibrary Path C TurboActuary3 0 bin TurboxXDebug TurboBase d 1 gt lt ExternalLibrary Path C TurboActuary3 0 bin TurboxDebug TurboTerml1 dl11 gt lt ExternalLibrary Path C TurboActuary3 0 bin TurboxXDebug TurboTerml App d11 gt Save and close it Open a blank Excel workbook and type the three formulas or use TurboX Navigator as following D6 d MyFirstTurboClass Class1 Hello 100 MyFirstTurboClass Class1 ctor C4 ThisY
61. tionString Utility Env TurboRoot Application Input Term TurboTerml TurboTermlInputs xlsx DatadccessLayer dataAccessLayer new DatadccessLayer excelFileNameOrDatabaseConnectionString RunEnum thisRun RunEnum MyFirstRun bie aie new GlobalSpec thisRun dataAccessLayer GlobalSpec Historical NestedNodes InterestCurveDefinition Vc ScenarioManagerFactory scenarloManagerFactory globalSpec scenarioManagerFactory Scenariollanager mainScenarioManager scenariollanagerFactory GetMainScenariollanager int scenarioNumber 1 DataTable planToRun dataAccessLayer Read PlanToRun Run Wuth thisRun tt DataQutput CreateTable new ColumnSpec Product typeof string new ColumnSpec Plan Group typeof string I k Profit Embedded Value foreach DataRow planRow in planToRun AsEnumerable DataTabl Boo ProductEnum product Utility ToEnum lt ProductEnum gt planRow Field lt string gt Product PlanGroupEnum planGroup Utility ToEnum lt PlanGroupEnum gt planRow Field lt string gt Plan Group PlanEnum plan Utility ToEnumPlanEnum gt planRow Field lt string gt Plan ie ape new PlanSpec dataAccessLayer Term globalSpec product planGroup plan thisRun DataTable modelPointRows ModelPointUtility GetModelPoints dataAccessLayer ModelPointTable plan TArray lt double gt embeddedValues new IArray lt double gt modelPointRows Rows Count TArray lt double
62. tomatically determine which kind of array it should use for best memory usage Page 30 Building Models Incrementally Incredible Order Miracle of Beauty Thus our software is extremely memory efficient when you choose to use namespace TurboSystem MemoryEfficientArray instead of TurboSystem FullSizeArray You can see that our calculation in the driver is always starting from the beginning of projection then to t 1 and until policy matures So you can trace your calculation very easily Other vendors may execute their programs out of time order thus hard to trace and understand their executions 4 4 Auto Generate Excel Model Other vendors use Excel to retrieve the calculated results but we generate the real actuarial Excel models automatically for you Create a spreadsheet with Objects tab what you need to do is to copy from example and make slight change since they almost have the same formulas except different object names For simplicity at this time you can create a copy of TurboTerm1 App xlsb and delete other three tabs except Objects tab Then Go to your calculation driver in Visual Studio and click Auto Generate Excel Formula From This Calculation Driver in TurboActuary main menu and click OK and xCopy you will get a new worksheet in your Excel workbook Page 31 Building Models Incrementally Incredible Order Miracle of Beauty Home Insert Page Layout Formulas TurboActuary Turbo Cont d Da
63. tures List Members Parameter Info Quick Info and Complete Word etc These features help you to learn more about the code you are using keep track of the parameters you are typing and add calls to properties and methods with only a few keystrokes Page 46 Building Models Incrementally vd TurboTerm1 App Microsoft Visual Studio File Edit View Project Build Debug BAM T Incredible Order File Edit View Project Build Copy Cyde Clipboard Ring Miracle of Beauty Debug Team SQL Tool Test Architecture TurboActuary An cule Debug la Ctrl X Ctrl C cyYear t 1 instead of use policyYear t 1 t Ti bec IssueMonth 12 1 Ctrl Shift V pivotTable policyYr planSpec Plan mpSpec SumAssuredAtIssuePP sumAssuredinde D R a K Paste Special gt PoP 4 N Delete Del Select All Ctri A enefit get protected set Find and Replace gt l to the sum assured at the end of previous Go To Ctrl G s month Navigate To Ctri a sibs ord ah thBenefit int t double deathRate_t double Insert File As Text Advanced gt Bookmarks d sumAssuredPP t 1 policies t 1 dea Outlin gt ate Refactor d lement Interface lement Abstract Class Members Ctri K L meter Info Ctrl K P Info Ctrl K I e Word Ctrl K W gle Completion Mode Ctrl Alt Space Snippet Ctrl K X ound With Ctrl K S te ARPs amp List Member you can get a list of valid members of a
64. uble bookProfit_t double inve EmbeddedValue TurboSystemJArray lt double gt distributabl ExpenselnflationRatiotint t FrankedProportioniint t System DateTime calendar_t j FrankedReturnint t IncomeBgiint t double policies_tm1 double premiumPP_t Income Endiint t double commChargeBackPP_t double lap Initialization protected virtual double StatReservePP int t return statReservePP t StatReserveModel reservePP t protected virtual double StatReserve int t double policies_t double statReservePP_t TurboAutoGenerated Th l S C a SS InvestincomeOfinterimCashFlowdint t double incomeBg_t InvestIncomeOfLiabilityB ackedAsset int t double investRet InvestincomeOfSurplusAssetiint t double investReturnRatet InvestReturnRateOnLiabilityBackedAsset int t double charg a InvestReturnRateOnSurplusAsset int t return statReservelt st N Blue base class public IArray lt double gt sta Green subclasses ed set f The refresh button will change the current class to the class in the active edit window TurboTermLTerm lt gt TurboTermLTermContract lt gt TurboTermLApp Term You can use filter to quickly find functions or fields The bottom pane in the Navigator shows its parent class and child classes You can easily see their hierarchy and walk through them by double clicking their names TurboTerm1 TermContract lt gt dm Current Class TurboBase
65. urboActuary main menu and then click Pick button Page 27 Building Models Incrementally Incredible Order Miracle of Beauty 4X Benefit Summary cs Demographics cs Program cs CashFlow cs Proxy DAG Premium cs Control and Time cs Turbo ermLApp Term Calculate using System Ling using System Text Project TurboTerm1 App Calculation Driver TurboTerm App Term Calculate using System Data using TurboSystem enerate driver only for picked methods using TurboBase for overloaded functions choose one of them using System Diagnostics and put Pick after its signature line using TurboSystem FullSizeArray f ine namespace TurboTerml App nerate driver for all methods public or protected q public partial class Term Term lt PlanSpec MpSpec gt eR EmbeddedValue distributableEarning Piek return this Cancel Trouble Shooting please use TurboBase project as reference rather than use TurboBase dll as reference Otherwise it may complain some functions arrays which are defined in TurboBase not found It will generate the Calculate function as Page 28 Building Models Incrementally Incredible Order Miracle of Beauty Age t age t 1 Calendar t ChargeableCapitalGainReturn t ExpenseInflationRatio t FrankedReturn t InvestReturnRateOnSurplusAsset t PolicyMonth t PolicyYear t StatReservePP t SumAssuredPP t TaxReservePP t
66. urboSystem i using TurboBase mAssuredPP int t using System Diagnostics taxOnPremiumPP namespace TurboTerm1 TaxOnPremiumPPiint t double premiumPP t taxReserve public partial class TermContract lt PlanSpec MpSpec gt Liability where PlanSpec TurboTerm1 PlanSpec where MpSpec TurboTerm1 MpSpec public IArray lt double gt sumAssuredPP get protected set lt summary gt The sumAssuredPP is the minimum amount payable to the assured or his her dependants on the death of the life assured It is flat amount or variable amount according to a given index table taxReservePP int pre v Page 50 Building Models Incrementally Incredible Order Miracle of Beauty You can use back and forth buttons to navigate codes just as you did in Internet Browser Explorer Chrome or Firefox File Edit View te E Or do bookmark the same way as your Internet Browser so you can visit it late using bookmarks File Edit View Project Build Debug Team SQL Tools Test Architecture TurboActuary Analyze M O ld P Continue Mee mo 66 ta Cf A AA Demographics cs amp CashFlow cs amp Proxy DAC cs amp Control and Time cs X Euu TurboBase Liabili PolicyYear int t nitialization brotected virtual int PolicyMonth int t if t mpSpec issueMonth 1 12 12 1 1 0 return policyMonth t t mpSpec IssueMonth 1 12 1 public IArray lt int
67. urboSystem TurboAsset TurboMath 3 2 Building Models Incrementally We use Objected Oriented design so we can build models incrementally Please refer to Appendix 1 Coding Reuse Inheritance We have provided rich libraries for liability Asset ALM You never have to write your models from scratch You only need to extend some library classes and put your customization codes in these new derived classes So you never mingle the codes of your new classes with the Page 13 Building Models Incrementally Incredible Order Miracle of Beauty codes of their base classes Your derived classes will inherit all functions from their base classes but you will decorate a few of them with your new code That is we have built all framworks for your mansions and you will decorate them in your style 3 3 Trace Main Function Execution In Debug configuration see the picture below hit F6 to rebuild the solution Debug Team SOL Tools Tes P Start Trouble Shooting if VS complains that the copy fails close all Excel books and retry In solution explorer expand the project TurboTerm1 App Console make sure it is the startup project i e it should have bold font If not right click the TurboTerm1 App Console and set it to be startup project Page 14 Building Models Incrementally Incredible Order Miracle of Beauty J LUBRANR SUNT GEVOEL J PTET VEPENDENOES Logging log Error Test for error log Hey this is a
68. xv TurboTerm1 App Term BookProfit this t Book Profit Before Tax Tax On Book Profit AM AO AT AU AV AP AQ AR AS Function Arguments Click it to bring Function Wizard TurboTerm1 App Term BookProfit This this TurboTerm1 App Term 14 Turb T ey 21 Book Profit BookProfitBeforeTax_t Book Profit Before Tax 5s 549 4003958 Book Profit Before Tax TaxOnBookProfit t Tax On Book Prof 337 2614831 2 000 828 212 1389127 so sag Return type System Double BookProfitBeforeTax t System Double bookProfitBeforeTax t sd 12 19 2 90 0 0097 0 0097 198 696 825 1 061 825 92 397 Do p oO p o ia o To view model assumptions you can go to Objects tab activate cell E9 and click the Object submenu You will see by clicking for all assumption details fe TurboTerm1 App PlanSpec ctor GlobalObjects Data Access Layer Plan GlobalObjects GlobalSpec Product Plan Group Plan GlobalObjects Run TurboTerm1 App PlanSpec Copyright C 2012 T a J i Copy XDUMP The Present Ersem NN Globalspec Dee EF NE 3 EN te TurboBase 2012 5 31 FixedAcgExpensePP 400 FixedDeathExpens FixedLapseExpens a Insurance 6 h FixedMaintExpense FixedMaturityExpe EEN MaintExpernseBeng MaintExpensePren Mortality TableEngi 14 Name O PivotTables HEN PivotT

Download Pdf Manuals

image

Related Search

Related Contents

Turning power off/on  Philips Softone Energy saving bulb 872790082614200    PC Authorize User`s Guide  owners manual manuel du propriétaire    MOLSHEIM-MutzIg - Marathon du Vignoble d`Alsace  Playskool Rockin' Radio 06095 User's Manual  ー・製品が届きましたら  Documentation - YASRT Raytracer  

Copyright © All rights reserved.
Failed to retrieve file