Tag : R

R-Packages in Windows

I need some functions over and over again. To avoid having to source them, to avoid having to copy them from project A to project B, to avoid having to re-write them, I quickly wrap them up in own r packages. Quick guide to putting fun1 and fun2 in your own package called mypkg

R does not round 2.5 to 3

In R’s default rounding function round() odd numbers ending with .5 are rounded up (from 1.5 to 2), but even numbers are rounded down (from 2.5 to 2 not to 3). This is compliant with a norm on rounding as outlined in the R documentation. I need to round 2.5 to 3 nevertheless in order to break an otherwise infinite loop in my iterative parameter approximation. Here is a solution I found on Stock Overflow who had it from statistically […]

Save parameters and seeds of simulations

Today, Robert posted the nice idea to save seeds of simulations. He recommends storing seeds with results, alternatively, store seeds with starting parameter values if you run numerical optimization. It is also useful to create an external file which stores parameters and seeds with a unique identifier which one can use for naming results folders and file organization. Th is post contains a code to do the latter.

Illustration of retention functions

Optimization via ML and SSE for Myung (2003)

R script implementing the tutorial on maximum likelihood estimation in Myung (2003). It optimizes a parametrized retention function via maximum likelihood and the sum of squared errors.