A current trend in robotics is to define robot motions so that they can be easily adopted to situations beyond those for which the motion was originally designed. In this work, we show how the challenging task of playing minigolf can be efficiently tackled by first learning a basic hitting motion model, and then learning to adapt it to different situations. We model the basic hitting motion with an autonomous dynamical systems, and solve the problem of learning the parameters of the model from a set of demonstrations through a constrained optimization. To hit the ball with the appropriate hitting angle and speed, a nonlinear model of the hitting parameters is estimated based on a set of examples of good hitting parameters. We compare two statistical methods, Gaussian Process Regression and Gaussian Mixture Regression in the context of inferring the hitting parameters for the minigolf task. We demonstrate the generalization ability of the model in various situations. We validate our approach on the 7 Degrees of Freedom (DoF) Barrett WAM arm and 6-DoF Katana arm in both simulated and real environments. © 2012 Copyright Taylor & Francis and The Robotics Society of Japan.