Cluster weighted models for functional data