# This function finds the best smoothing parameter for the canonical correlation analysis for both groups of variables by using leave-one-out (sample) cross validation. The criterion here is to maximise the first canonical correlation.

### Description

This function carries out the canonical correlation analysis between a scalar variable and a list of mixed scalar and functional variables. There are four choices of the returned values and three representation methods of the functional variables.

### Usage

1 2 |

### Arguments

`xL1` |
The mixed scalar and functional variables. For any number and any type of variables, |

`xL2` |
Same as |

`method` |
The representative methods for the functional coefficients. The method could be one of the 'basis', 'gq' and 'raw' for basis function expression, Gaussian quadrature and representative data points, respectively. |

`centre` |
Logic argument. Default is |

`tol` |
The threshold to decide whether the correlation is to small to be non-zero. |

`Control1` |
List of elements that controls the details of the functional coefficients for |

`Control2` |
Similar to |

`alpha` |
Candidate tuning parameters for the smoothness of the functional coefficients. |

### Details

Note that the smoothing parameters for both groups of variables are assumed to be the same. This is due to high computational cost of cross validation. See the example in `fccaXX`

.

### Value

`cor` |
A vector of the first canonical correlation. Each element of the vector is corresponding to one of the candidate tuning parameters. |

`alpha` |
The corresponding tuning parameters. |