Added a minic function to estimate parameters