e04yc {NAGFWrappers} R Documentation

## e04yc: Covariance matrix for nonlinear least squares problem (unconstrained)

### Description

e04yc returns estimates of elements of the variance-covariance matrix of the estimated regression coefficients for a nonlinear least squares problem. The estimates are derived from the Jacobian of the function f(x) at the solution.

This function may be used following any one of the nonlinear least squares functions e04fc e04fy e04gb e04gy e04gd e04gz e04he e04hy.

### Usage

```e04yc(job, m, fsumsq, s, v,
n = nrow(s))
```

### Arguments

 `job` integer Which elements of C are returned as follows: job = - 1: The n by n symmetric matrix C is returned. job = 0: The diagonal elements of C are returned. job > 0: The elements of column job of C are returned. `m` integer The number m of observations (residuals f_i(x)). `fsumsq` double The sum of squares of the residuals, F(barx), at the solution barx, as returned by the nonlinear least squares function. `s` double array The n singular values of the Jacobian as returned by the nonlinear least squares function. See the Description in Fortran library documentation for information on supplying s following one of the easy-to-use functions. `v` double array The n by n right-hand orthogonal matrix (the right singular vectors) of J as returned by the nonlinear least squares function. See the Description in Fortran library documentation for information on supplying v following one of the easy-to-use functions. `n` integer: default = nrow(s) The number n of variables (x_j).

### Details

R interface to the NAG Fortran routine E04YCF.

### Value

 `V` double array If job >= 0, v is unchanged. `CJ` double array If job = 0, cj returns the n diagonal elements of C. `IFAIL` integer ifail =0 unless the function detects an error or a warning has been flagged (see the Errors section in Fortran library documentation).

NAG

### Examples

```
ifail <- 0

job <- 0

m <- 15

fsumsq <- 0.00821487730657898

s <- matrix(c(4.096503460741, 1.59495793805472, 0.0612584931217495),
nrow = 3, ncol = 1, byrow = TRUE)

v <- matrix(c(0.935395908691802, 0.352951220949886,
-0.0214459700788422, -0.259228425671719, 0.643234592093676,
-0.72045116618536, -0.240489328924174, 0.679466478322564,
0.693173995119214), nrow = 3, ncol = 3, byrow = TRUE)

e04yc(job, m, fsumsq, s, v)

```

[Package NAGFWrappers version 24.0 Index]