Posts Tagged ‘ C ’

Bubble sorting in R, C++ and Julia: code improvements and the R compiler

December 28, 2013
By

In the past few months I have written posts about implementing the bubble sort algorithm in different languages. In the mean while I have gotten some feedback and suggestions regarding improvements to the implementation I made, see the end of… See more ›

Read more »

Parallel Tempering Algorithm with OpenMP / C++

Parallel Tempering Algorithm with OpenMP / C++

1.1. Parallel Tempering Theory 1.2. Physics Origins 2.1 Intra-Thread Metropolis Move 2.2. Inter-Thread Parallel Tempering 2.3. OpenMP Parallelization 3. Full Code 4. Simulation Study 5. On the Future use of Parallel Tempering with OpenMP Parallel tempering is one of my favourite sampling algorithms to improve MCMC mixing times. This algorithm seems to be used exclusively […] The post Parallel Tempering Algorithm with OpenMP / C++ appeared first on Lindons Log.

Read more »

Variable probability Bernoulli outcomes – Fast and Slow

November 1, 2012
By
Variable probability Bernoulli outcomes – Fast and Slow

I am working on a project that requires the generation of Bernoulli outcomes. Typically, I would go about this using the built in sample() function like so: This works great and is fast, even for large n. Problem is, I want to generate each sample with its own unique probability. Seems straight forward enough, I

Read more »

MCMC on the Raspberry Pi

July 7, 2012
By
MCMC on the Raspberry Pi

I’ve recently taken delivery of a Raspberry Pi mini computer. For anyone who doesn’t know, this is a low cost, low power machine, costing around 20 GBP (25 USD) and consuming around 2.5 Watts of power (it is powered by micro-USB). This amazing little device can run linux very adequately, and so naturally I’ve been […]

Read more »

Methods for calculating least squares

June 26, 2012
By

In several earlier posts, I detailed some C# code for calculating regression models, by simply converting text book equations in to code. I’ve always been aware that this may not be the best implementation as matrix methods can become numericall...

Read more »

Using R.Net in an Excel Add in

May 31, 2012
By

I thought I’d try out R.net and in doing so I have put together a very simple Excel 2007 add in that connects Excel to R. I’m using .Net 4.0 in Visual Studio 2010 pro with the latest commit of R.Net, … Continue reading →

Read more »

Fourier Transforms

May 7, 2012
By

As an example of how to get started with using fast Fourier transforms (FFT)  in C# I’ve produced the classic example of looking at Sun spot data. As always I’m using the Math.Net library, and having been introduced to FFTs … Continu...

Read more »

Box Plots in Excel

March 27, 2012
By

Having finally brought a personal copy of Visual Studio 2010 Pro I wanted to have a go at an Excel add in using Visual Studio Tools for Office (VSTO). It has been a long time since I used VBA and … Continue reading →

Read more »

simulated annealing for Sudokus [2]

March 16, 2012
By
simulated annealing for Sudokus [2]

On Tuesday, Eric Chi and Kenneth Lange arXived a paper on a comparison of numerical techniques for solving sudokus. (The very Kenneth Lange who wrote this fantastic book on numerical analysis.) One of these techniques is the simulated annealing approach I had played with a long while ago.  They seem to use the same penalisation [...]

Read more »

Colour Bar

March 14, 2012
By

I needed to indicate the change in a signal over time on a single chart and so wanted a colour gradient, ideally something like the Jet colour scheme in MATLAB. In the end I basically converted the MATLAB code into … Continue reading →

Read more »


Subscribe

Email:

  Subscribe