# cora

Calculates correlation metric between CAE and Test Data signals in the form of time history. Includes both corridor and cross correlation, which are calculated independently and then combined to give a comprehensive error. The error calculation can be biased towards either the measured time history(Test) or the computed (CAE) time history, with the former being most common.

## Syntax

cora(inputstruct,refcurve,compcurves)

cora(inputstruct,refcurve,[compcurve1, compcurve2, compcurve3,...])

cora(inputstruct,[refcurve1,refcurve2,refcurve3,...],compcurves)

cora(inputstruct,[refcurve1,refcurve2,refcurve3,...],[compcurve1, compcurve2, compcurve3,...])

out1 = cora(...)

[out1,out2] = cora(...)

## Inputs

`inputstruct`- Struct with method parameters, if different from the default values. Only the parameters whose values are different from default need to be declared. If all default values should be used, an empty struct should be given in this argument.
`refcurve`- Reference curve(s). Minimum required input needs to be a 2-column matrix with X and Y reference data. Multiple pairs of curves can be given and every 2 columns will be considered as a different reference dataset.
`compcurve`- Comparison curve(s). Minimum required input needs to be a 2-column matrix with X and Y comparison data. Multiple pairs of curves can be given and every 2 columns will be considered as a different comparison dataset.

## Outputs

- out1
- nx6 output. The n rows correspond to different correlation curves. The 6 columns correspond to CORA rating, corridor rating, total cross correlation, phase rating, progression rating and size rating
- out2
- nx16 output. The n rows correspond to different correlation curves. The 16 columns correspond to inner correlation, outer correlation, Y norm, T min, T max, Gv, Gg, Gp, G1, G2, a0, b0, asigma, bsigma, min delta and max delta

## Example

Usage of cora with 1 reference curve and 3 comparison curves, using default parameter values.

```
refcurve1 = [1:20; 1:20']';
compcurve1 = [1:20; 31:50]';
compcurve2 = [1:20; 41:60]';
compcurve3 = [1:20; 51:70]';
inputstruct = struct();
[out1,out2] = cora(inputstruct,refcurve1,[compcurve1, compcurve2, compcurve3])
```

```
out1 = [Matrix] 3 x 6
0.18878 0.00000 0.37756 0.00000 0.70687 0.09651
0.17546 0.00000 0.35092 0.00000 0.67095 0.06175
0.16719 0.00000 0.33438 0.00000 0.64733 0.04285
out2 = [Matrix] 3 x 16 Rows[1:3] Columns[1:11]
1.00000 10.00000 20.00000 1.00000 16.19000 0.50000 0.25000 0.25000 0.50000 0.50000 0.05000
1.00000 10.00000 20.00000 1.00000 16.19000 0.50000 0.25000 0.25000 0.50000 0.50000 0.05000
1.00000 10.00000 20.00000 1.00000 16.19000 0.50000 0.25000 0.25000 0.50000 0.50000 0.05000
out2 = [Matrix] 3 x 16 Rows[1:3] Columns[12:16]
0.50000 0.00000 0.00000 0.15190 1.82280
0.50000 0.00000 0.00000 0.15190 1.82280
0.50000 0.00000 0.00000 0.15190 1.82280
```

Usage of cora with 3 reference curves and 1 comparison curve, setting the value of a_thres parameter.

```
refcurve1 = [1:20; 1:20']';
refcurve2 = [1:20; 11:30]';
refcurve3 = [1:20; 21:40]';
compcurve1 = [1:20; 31:50]';
inputstruct.a_thres = 0.1;
[out1,out2] = cora(inputstruct,[refcurve1,refcurve2,refcurve3],compcurve1)
```

```
out1 = [Matrix] 1 x 6
0.31246 0.04938 0.57553 0.00000 0.96782 0.36647
out2 = [Matrix] 1 x 16 Row[1] Columns[1:11]
2.50000 25.00000 50.00000 1.00000 20.00000 0.50000 0.25000 0.25000 0.50000 0.50000 0.05000
Row[1] Columns[12:16]
0.50000 0.00000 0.00000 0.19000 2.28000
```