Ben Chuanlong Du's Blog

It is never too late to learn.

Erase Elements of a Container Using Iterator in C++

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

@TODO: make a general discuss about removing elements form containers ...

vector -> best to remove backwards ...

You cannot erase elements from a container using the function std::for_each or the range-based for …

Const and Static Variables in C++

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Const Variables

but you can initialize a static constexpr variable inside the defintion of a class.

  1. constexpr means that the corresponding value can be dertermined at compile time.

Static Variables

  1. You …

AR1X Process

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

  1. talk about the ar1x process, and your simulation, GLM might not be as good as OLS for estimating parameters, but be careful about inference, why? you use do inference based on …

For Loops in C++

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

There are 3 for loops in C++, the usual for loop, the range-based for loop (introduced in C++11) and the std::for_each for loop.

  1. Both the range-based for loop and …

Variance and Dispersion Estimate in Genetics

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

The basic idea is to borrow information across genes. Some assume a distribution for the variances/dispersions while others not.

Least Square Estimates

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Ordinary Least Square

Weighted Least Sqaure

  1. Heterogeneous variance

close results to transformation