# Main function for specifying RCON/RCOR models

### Description

This is the main function for specifying and fitting RCON/RCOR models in the package along with certain utility functions.

### Usage

1 2 3 4 |

### Arguments

`gm` |
Generating class for a grapical Gaussian model, see 'Examples' for an illustration |

`vcc` |
List of vertex colour classes for the model |

`ecc` |
List of edge colour classes for the model |

`type` |
Type of model. Default is RCON |

`method` |
Estimation method; see 'Details' below. |

`fit` |
Should the model be fitted |

`data` |
A dataframe |

`S` |
An empirical covariance matrix (as alternative to giving data as a dataframe) |

`n` |
The number of observations (which is needed if data is specified as an empirical covariance matrix) |

`Kstart` |
An initial value for K. Can be omitted. |

`control` |
Controlling the fitting algorithms |

`details` |
Controls the amount of output |

`trace` |
Debugging info |

### Details

Estimation methods:

'ipm' (default) is iterative partial maximization which when finished calculates the information matrix so that approximate variances of the parameters can be obtained using vcov().

'ipms' is iterative partial maximization without calculating the information matrix. This is the fastest method.

'scoring' is stabilised Fisher scoring.

'matching' is score matching followed by one step with Fisher scoring.

'hybrid1' is for internal use and should not be called directly

### Value

A model object of type 'RCOX'.

### Note

demo("gRc-JSS") gives a more comprehensive demo.

### Author(s)

S<f8>ren H<f8>jsgaard, sorenh@agrsci.dk

### Examples

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ```
data(math)
gm = ~al:an:st
vcc = list(~me+st, ~ve+an, ~al)
ecc = list(~me:ve+me:al, ~ve:al+al:st)
m1 <- rcox(gm=gm, vcc=vcc, ecc=ecc, data=math, method='matching')
m2 <- rcox(gm=gm, vcc=vcc, ecc=ecc, data=math, method='scoring')
m3 <- rcox(gm=gm, vcc=vcc, ecc=ecc, data=math, method='ipm')
m1
m2
m3
summary(m1)
summary(m2)
summary(m3)
coef(m1)
coef(m2)
coef(m3)
vcov(m1)
vcov(m2)
vcov(m3)
``` |