Statistical inference of C- and D-vine copulas