Structure parameter estimation algorithms for model selection I,II