# Re: [S] Var-Covar Matrices of non-linear parameters

Douglas Bates (bates@stat.wisc.edu)
11 Jun 1998 11:25:32 -0500

Pedro de Barros <pbarros@ualg.pt> writes:

> I am trying to find a way of obtaining the variance-covariance matrix for
> the estimated parameters when running nlregb(), nls() or nlminb(),
> equivalent to the "var" component of a glim() fit. (I want a simple way of
> estimating confidence limits for the parameters).

If you want to calculate confidence limits on the parameters in an nls
fit you could use the approximate standard errors reported by the
summary function. The object returned by the summary function applied
to a fitted nls model has several components. One of these components
is a matrix of parameter values, standard errors, and the t statistic.

> Pur <- Puromycin[Puromycin\$state == "treated", ]
> Pur
conc vel state
1 0.02 76 treated
2 0.02 47 treated
3 0.06 97 treated
4 0.06 107 treated
5 0.11 123 treated
6 0.11 139 treated
7 0.22 159 treated
8 0.22 152 treated
9 0.56 191 treated
10 0.56 201 treated
11 1.10 207 treated
12 1.10 200 treated
> fm1Pur <- nls(vel ~ Vm*conc/(K+conc),
+ data = Pur, start = list(Vm = 200, K = 0.05))
> names(summary(fm1Pur))
[1] "parameters" "sigma" "df" "cov.unscaled" "correlation"
[6] "formula"
> summary(fm1Pur)\$parameters
Value Std. Error t value
Vm 212.68204577 6.947062329 30.614674
K 0.06411864 0.008280667 7.743173

If you want the approximate variance-covariance matrix for these
parameters you can combine the sigma component and the cov.unscaled
component.

> sum1Pur <- summary(fm1Pur)
> sum1Pur\$cov.unscaled
Vm K
Vm 0.4037117606 3.681653e-04
K 0.0003681653 5.735874e-07
> sum1Pur\$sigma
[1] 10.93366
> (sum1Pur\$sigma)^2 * sum1Pur\$cov.unscaled # variance-covariance matrix
Vm K
Vm 48.26167500 4.401227e-02
K 0.04401227 6.856944e-05
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news