Monthly Archives: January 2013

R for actuarial science

January 10, 2013
By
R for actuarial science

As mentioned in the Appendix of Modern Actuarial Risk Theory, “R (and S) is the ‘lingua franca’ of data analysis and statistical computing, used in academia, climate research, computer science, bioinformatics, pharmaceutical industry, customer analytics, data mining, finance and by some insurers. Apart from being stable, fast, always up-to-date and very versatile, the chief advantage of R is that...

Read more »

Stacked Bar Charts in R

January 10, 2013
By
Stacked Bar Charts in R

Reshape Wide to LongLet's use the Loblolly dataset from the datasets package. These data track the growth of some loblolly pine trees.> Loblolly   height age Seed1    4.51   3  30115  10.89   ...

Read more »

Vector fields with streamlines

January 10, 2013
By
Vector fields with streamlines

A new version of rasterVis is available at CRAN. This version includes several bug fixes and a new method to …Continuar leyendo »

Read more »

Install R in Ubuntu 12.04 Precise Pangolin

January 10, 2013
By

R is a free software environment for statistical computing and graphics. It compiles and runs on a wide variety of UNIX platforms, Windows and MacOS. One of my main motivations to install R is Sweave. The Sweave is a literate programming language which integrates LaTeX and R code. The main idea of the Sweave is to combine data analysis code...

Read more »

Lomb-Scargle periodogram for unevenly sampled time series

January 10, 2013
By
Lomb-Scargle periodogram for unevenly sampled time series

In the natural sciences, it is common to have incomplete or unevenly sampled time series for a given variable. Determining cycles in such series is not directly possible with methods such as Fast Fourier Transform (FFT) and may require some degree o...

Read more »

Lomb-Scargle periodogram for unevenly sampled time series

January 10, 2013
By
Lomb-Scargle periodogram for unevenly sampled time series

In the natural sciences, it is common to have incomplete or unevenly sampled time series for a given variable. Determining cycles in such series is not directly possible with methods such as Fast Fourier Transform (FFT) and may require some degree of interpolation to fill in gaps. An alternative is the Lomb-Scargle method (or...

Read more »

Optimizing parameters for an oscillator – Video

January 10, 2013
By

Here’s a video how the modFit function from the FME package optimizes parameters for an oscillation. A Nelder-Mead-optimizer (R function optim) finds the best fitting parameters for an undampened oscillator. Minimum was found after 72 iterations, true parameter eta was -.05: Evolution of parameters in optimization process from Felix Schönbrodt on Vimeo. More on estimating

Read more »

A first lambda function with C++11 and Rcpp

January 10, 2013
By

Yesterday’s post started to explore the nice additions which the new C++11 standard is bringing to the language. One particularly interesting feature are lambda functions which resemble the anonymous functions R programmers have enjoyed all along...

Read more »

Reading Codebook Files in R

January 10, 2013
By

One issue I continuously encounter when starting to work with a new dataset is that of the codebook. In general, I prefer to load a codebook into R like any other data source, specifically as a data frame. And ideally, one data frame to provides the variable names with descriptions and any other meta data available, and a separate...

Read more »

Maps in R: Plotting data points on a map

January 10, 2013
By
Maps in R: Plotting data points on a map

In the introductory post of this series I showed how to plot empty maps in R. Today I'll begin to show how to add data to R maps. The topic of this post is the visualization of data points on … Continue reading →

Read more »