Using with Rapp free actuarial program and examples   --   2023-02-13, Stig Rosenlund
Windows XP or later is required. Start by downloading and installing MiKTeX from internet if you don't already have it. Just google miktex. The Basic Installer is sufficient. At present you can use Choose 64-bit for a 64-bit computer. Rapp produces text files with PostScript code which are made to Pdf with the MiKTeX ps2pdf command. Alternatively you can use Adobe Acrobat Distiller as stated in the manual with the help of Pgm\Ps2pdfAD.Bat. MiKTeX is free, while Acrobat Distiller costs money.

Bare bones use of Rapp
Assume that you have put the Rapp files in the folder C:\Rapp. In the Command Prompt, make the bat-file Br.Bat in the directory you come to by writing the command Notepad Br.Bat. Enter the following text and close.

@echo off
echo You run exe-files primarily from C:\Rapp\Pgm.
set "FromCmdPrompt=Yes"
CD C:\Rapp\Rpp

After having made Br.Bat you enter an environment for running Rapp by the command Br in the Command Prompt. There you run a file name.rpp by Rapp name. A file with an extension, say xxx, other than rpp is run with Rapp Example

Rapp Helloworld
Rapp Helloworld.Rpp

You can associate Rapp.Exe to a file with extent .Rpp in the Explorer, so that double-click on such a file will run Rapp with the file (open the file with Rapp). To get hold of Rapp for Open (via Open with and Always use) can be tricky - you might have to scroll down and double-click on empty space several times.

Place a shortcut to C:\Rapp\Pgm\Rappmenus.Exe on the desktop or Start menu.

You might have to delete the folder
if it exists, before downloading a new version of Rappmenus.Exe.

Rappmenus.Exe is not installed. An installation would remove old technical parameter files, but you have to do it yourself.

Optional extras over bare bones use
The Rapp files are still assumed to be in the folder C:\Rapp. Run C:\Rapp\Pgm\Assoc.Bat as administrator. Answer Y at the question Continue?. That will create the above-mentioned association and more. Descriptions and icons will be added.

****** Text to read if the Rapp files are not in C:\Rapp. ******
Unzip the folders of to suitable locations. They need not all be under the same folder. But assume that Pgm was placed as C:\Rapp\Pgm and the other folders also were put under the folder Rapp. Then run C:\Rapp\Pgm\Adapt.Exe. It can be run also at other locations. If Assoc.Bat was created in the working directory, run it for info. At answer N nothing happens. To make a partial installation with file type associations etc, run again as administrator, answering Y. At a workplace this must probably involve an IT-person. You can edit Assoc.Bat as instructed in its code.
****** End text to read if the Rapp files are not in C:\Rapp. ******

More explanations
Assoc.Bat is not essential. But if you move Rapp.Exe after associating it as open program for files .Rpp, then you might have difficulties associating it again. Assoc.Bat fixes that. There is already an Assoc.Bat in the zip file assuming Rapp.Exe is in C:\Rapp\Pgm.

C:\Rapp\Pgm\Rapp.Exe is for a 64-bit computer. For 32-bit, replace C:\Rapp\Pgm\Rapp.Exe with C:\Rapp\Pgm\Rapp32Vc2017.Exe. For more info on the Rapp exes, see and subpages.

See C:\Rapp\Dok\Rapp-run-and-edit.doc for info on running and editing Rapp programs. Below a summary.

In the Explorer you run Rapp as usual by double-click or right-click and Open with.

After having made Br.Bat you enter an environment for running Rapp by the command Br. There you run Rapp from the Command Prompt in C:\Rapp\Rpp. Eg: Rapp "Mangle1", or Rapp "Mangle1.Rpp". More arguments can be passed on the command line, but you will not often need these. Quotation marks are needed for names with embedded blanks. Many Rapp users name their programs with extent .sas in order to use the SAS editor for developing Rapp programs. Then the extent must be present in the command, eg Rapp Mangle1.Sas.

Now you can start to run Rapp programs in C:\Rapp\Rpp. They can all be run directly, using fictitious data, provided you first run Mangle1.Rpp and Mangle2.Rpp to create data for reserves, maps and tariff analysis, respectively. And you can use the menus of the Visual C# application C:\Rapp\Pgm\Rappmenus.Exe.

The menu has numerous right-click information windows. Dynamically generated Rapp programs in Rappmenus can be edited and run outside the menu. The example programs can be edited to change names of in- and out-files. You can do it with a Rapp program:  Proc Chaall root(F:\Dept01\Rapp\Rpp) files(*.*) cha("C:\Rapp" "F:\Dept01\Rapp") Ci Endproc
You can also use choice Change all in Rappmenus / Utilities, which generates and runs a Rapp progam with Proc Chaall.

Initial steps in directory C:\Rapp\Rpp after MiKTeX download and Br
Rapp Mangle1
Rapp Mangle2
Rapp Taran-demo

Check the Pdf file. If the text is too high up, so that the page numbers are not visible, or too low, then adjust pdfoffset() in Init.Rpp. If too high decrease the value from pdfoffset(14) to pdfoffset(0) or some other suitable value. Negative values are allowed. If too low increase the value. You will have to experiment.

Initial steps for C:\Rapp\Pgm\Rappmenus.Exe
Place a shortcut to it on the desktop or Start menu.
Start the program and write the full path C:\Rapp\Pgm\Rapp.Exe in the text box.
Enter the menus and open some parmfile in each. See the table at the bottom for parmfile directories.

In the menus Bich and Reserves of Rappmenus.Exe you open parmfiles. (They could be called projects.) Look in C:\Rapp\BRparm. The manual is Dok\Resvmane.pdf. DemoRDC2.Txt has parameters for performing the GLM RDC/RBNS analysis. There is also a simpler menu "Simple triangle based reserves". Look in C:\Rapp\Sparm. (S for Simple.)

You create C:\Rapp\Data\ResI-2.Txt and C:\Rapp\Data\ResP-2.Txt with Mangle1.Rpp. It will take between 3 and 10 seconds with a modern computer. They have arguments 2, 3, 4 appended to argument 1 underscore-separated. This facilitates GLM analysis of RDC/RBNS reserves.

Two lines from ResP-2.Txt
00000000000000001 07_07_HC_130 07 HC 130 0 20110501 20110501 20110501 20110901   695
00000000000000002 38_07_HC_010 07 HC 010 1 20110101 20110101 20110101 20110901 1339

These files are input in parmfile C:\Rapp\BRparm\DemoRDC2.Txt.

Tariff analysis
There is a large file C:\Rapp\Data\Fors0.Txt with insurances and a smaller file C:\Rapp\Data\Skad1.Txt with claims. To use tariff analysis programs C:\Rapp\Rpp\Taran.Rpp and the other ones beginning with Taran, you first run C:\Rapp\Rpp\Mangle2.Rpp. This matches info from C:\Rapp\Data\Breeds.Txt and produces a new file C:\Rapp\Data\Fors1.Txt with exposures computed. Takes between 20 and 60 seconds. Then Fors1.Txt and Skad1.Txt are input to the tariff analysis programs.

For the menu Tariff analysis you open parmfiles, as for Reserves. Look in C:\Rapp\Tparm.

Freestanding credibility
Proc Taran has my credibility pseudo-estimators built-in , but the menu "Credibility" provides a simpler framework. You open parmfiles also here. Look in C:\Rapp\Hparm. There are templates in that folder, with which you can perform non-hierarchical and hierarchical credibility on two small files in Rapp\Data, containing insurances and claims which I have simulated.

Data mangling in menu
Some of the Rapp data mangling facilities are available in the menu Data mangling of Rappmenus.Exe. Namely elimination of overlapping insurance periods and temporal overmatching of insurance info to claims. These draw on my long experience of constructing actuarial data warehouses at Länsförsäkringar Alliance and WASA Insurance. Look for parmfiles in C:\Rapp\Dparm.

Multiprecision computing
In 2015 and 2016 I have added a mathematical language, which I call Mbasic, within the language Rapp. The M in Mbasic stands for Multiple precison, ie you choose the number of correct decimal digits up to 306 with Rapp.Exe for a floating data type called mouble. Variants of Rapp.Exe can handle up to 9000 digits, although for some complicated functions the results will have a maximum of 306 correct digits. The common double data type with an 8-byte storage is also available. Also M stands for Matrix Basic.

Mbasic has all elementary and inverse circular functions and also matrix calculus. The normal probability distribution function, its inverse and related functions. The Gamma and Psi functions. The incomplete Gamma function, ie the Gamma distribution function. Bessel functions of the first and second kind. In 2017 I have added complex calculus. All elementary operations, some functions and matrix calculus are implemented.

There is a graphical shell for Mbasic in Rappmenus. Or you can use a text editor you are accustomed to for writing Mbasic programs within a Rapp proc called Proc Mbasic.

Text editor Sred
In the folder Pgm is a free-standing text editor named Sred. It is the default editor for reading text files that appear in Rappmenus. It can be used outside Rappmenus.

To start using Sred, download it to a suitable folder. Double-click on it to open it. You will get a screen saying Don't run. Click on More information and after that Run anyway. I suggest making a folder C:\Program\Sred and putting Sred.Exe there as C:\Program\Sred\Sred.Exe. If not permitted, make C:\Sred and C:\Sred\Sred.Exe.

Make a file with extent .txt and right-click on it and choose Open with. Choose Another app and go to C:\Program\Sred\Sred.Exe (it might show as Sred only). After open you have a manual with right-click on top.

You can collect internet links, one per row. Blanks rows between links are for better legibility. Open with F2 on a link. See the context menu for F2 to the right of Show F-keys obtained with right-click. Examples.

An arithmetic expression is evaluated with F11 or F12. See manual at right-click on top.

Search on the strip second from top gives a search engine that is better than the one in the Explorer.

Overview of folders for programs, data and documentation
BRparm Parmfiles for Bich stochastic reserving and Reserves. Any parmfile will work for both applications.
Data Input files to Rapp. Kpi.Txt and Kpim.Txt contain the Swedish CPI. Download new data from
Dok Manuals Rappmane.doc, Rappmane.pdf and Resvmane.pdf.
Dparm Parmfiles for Data mangling.
Hparm Parmfiles for freestanding credibility.
Jt Info on available RAM, created new each month, and temporary files. You can visit the folder sometimes to delete files left after crashes. If you prematurely close a window where Rapp executes, there will most often be temporary files left. If you do not delete files, they will be deleted automatically once a month.
MapdataCoordinate files and other input files to Proc Map. Mangle2.Rpp transforms Europe01.svg.
Mbparm Parmfiles for the edit menu for Mbasic and Rapp in general.
Mparm Parmfiles for Maps. Contains three templates that can be run with available files in Mapdata after Mangle2.Rpp and one template for submenu Svg2co.
Pgm AllInOne.htm, Adapt.Exe, Ps2pdfAD.Bat, Rapp.Exe, Rapp32Vc2017.Exe, Rappmenus.Exe and Rapp icon.
Rpp Rapp programs and a few small data text files.
Sparm Parmfiles for "Simple triangle based reserves".
Tparm Parmfiles for Tariff analysis.
Uparm Parmfiles for Utilities with Change all, Compare, Copy, Disk space computation, File statistics and Sort.

Output folders
Pdf Output Pdf files. They are accessible for browse in Rappmenus.
Txt Output text files. You will normally not need to edit these. They are intermediary to Pdf and Xml files.
Xml Output Excel files. Accessible for edit in Rappmenus. Four files are already there for the Xlmerg.Rpp example program.

Send questions & bug reports to !