Using nonlinear functional relationship regression to fit fisheries models

3 downloads 2494 Views 521KB Size Report
regression to fit fisheries models. Daniel K. Kimura. Abstract: Functional relationship regression refers to that class of statistical model where a functional ...
Color profile: Disabled Composite Default screen

160

Using nonlinear functional relationship regression to fit fisheries models Daniel K. Kimura

Abstract: Functional relationship regression refers to that class of statistical model where a functional relationship is assumed to exist between two arithmetic variables, but the two arithmetic variables can only be viewed with measurement error and (or) natural variability. The goal is to estimate the underlying functional relationship when observing only the variables containing error or natural variability. While statistical details need to be worked out, some general approaches to this class of problem can be recommended. First of all, nonlinear least squares can provide maximum likelihood estimates when the error variance ratio, λ, is assumed known. Furthermore, the usual estimates of standard errors from nonlinear least squares, while theoretically flawed for this class of model, appear to provide usable estimates for many practical problems. Next, a K-sample F test, for testing the equality of nonlinear functional relationship regression curves, is proposed. Finally, computer memory-saving algorithms are suggested for situations where sample sizes are large. Methods proposed here are applied to three types of functional curves commonly estimated in fisheries biology: a stock–recruitment curve, allometry, and the von Bertalanffy growth curve. Résumé : Les modèles de régression de relation fonctionnelle forment une classe de modèles statistiques pour lesquels on suppose l’existence d’une relation fonctionnelle entre deux variables arithmétiques qui ne peuvent être décelées que par l’erreur de mesure et (ou) la variabilité naturelle. L’objectif recherché consiste à estimer la relation fonctionnelle sous-jacente de par la seule observation des variables présentant une erreur ou de la variabilité naturelle. Bien qu’il reste certains détails statistiques à régler, certaines approches générales à cette classe de problèmes peuvent cependant être recommandées. Tout d’abord, une méthode par moindres carrés non linéaires peut permettre d’obtenir des destinations par maximums de vraisemblance lorsque le rapport de la variance de l’erreur, λ, est supposé connu. En outre, les estimations habituelles des erreurs-types par méthode des moindres carrés non linéaires, qui en théorie s’avèrent biaisées pour cette classe de modèles, semblent cependant fournir des estimations utiles pour la solution de bon nombre de problèmes pratiques. On propose ensuite l’utilisation du test F à échantillon K pour le test de l’égalité des courbes de régression des relations fonctionnelles non linéaires. Pour terminer, des algorithmes économiseurs de mémoire sont proposés pour les situations où l’effectif de l’échantillon est important. Les méthodes proposées sont appliquées à trois types de courbes fonctionnelles couramment estimées en biologie des pêches : la courbe de stock– recrutement, la courbe d’allométrie et la courbe de croissance de von Bertalanffy. [Traduit par la Rédaction]

Kimura

170

Introduction Ordinary regression generally assumes either that sampling is from a multivariate normal distribution or that independent variables are measured without error and all error is a result of observing the dependent variable. This is not a satisfactory paradigm for many biological problems where nearly all variables are observed with large amounts of either sampling (i.e., measurement) error or natural (i.e., individual genetic and environmental) variability (Ricker 1973). Strictly speaking, these data often fail the assumptions of ordinary regression and can be viewed as requiring measurement error models for proper interpretation. Hilborn and Walters (1992) recognized this “errors in variables” problem and suggested evaluating statistical bias using simulation.

Received January 18, 1999. Accepted July 6, 1999. J14978 D.K. Kimura. Alaska Fisheries Science Center, National Marine Fisheries Service, Building 4, Bin C15700, 7600 Sand Point Way NE, Seattle, WA 98115-0070, U.S.A. e-mail: [email protected] Can. J. Fish. Aquat. Sci. 57: 160–170 (2000)

J:\cjfas\cjfas57\cjfas-01\F99-200.vp Friday, January 14, 2000 9:11:41 AM

Fuller (1987) provided what may be the most definitive treatment of measurement error models in the literature. There are two basic classes of measurement error models: functional and structural regression. These models are distinguished in their assumptions concerning the “true” independent variable xi. Functional regression assumes that the true independent variables are unknown constants, while the structural models assume that the true independent variables are normally distributed. The assumptions required for parameter estimation for the linear function are quite different for the two classes of models (e.g., see Kendall and Stuart 1973). Measurement error models, unfortunately, have had a controversial past that has beclouded their innate simplicity and usefulness. The purpose of this paper is not to contribute further to this debate (the author has already made one attempt; Kimura 1992), but simply to illustrate some statistical methods that are available for the functional relationship regression model. The author believes that functional relationship regression can be a useful alternative to ordinary regression, especially when it is obvious that ordinary regression assumptions do not hold. Towards this end, the author suggests methods for performing the basic tasks of © 2000 NRC Canada

Color profile: Disabled Composite Default screen

Kimura

161

estimating parameters, estimating standard errors, and testing the hypothesis of equality between regression curves estimated from different samples. Each of these tasks can be performed reasonably using standard least squares methods with fairly minor adjustments.

dient matrix of the parameter estimates. Let g be the 2n-dimensional vector of expected values, g′ = { f (x1, β),..., f (xn, β), x1 λ ,..., xn λ }. The 2nx(n + p) gradient matrix Z = {zij}, where zij = ∂gi /∂θ j and θ′ = {β1,...,βp, x1,..., xn}, gi is the ith entry of g, and θ j is the jth entry of θ. n

$ 2 + λ [X – x$ ]2}/(n – p), all evaluated Also, let s$ 2 = Σ {[Yi – f (x$ i , β)] i i

i =1

at the least squares solution θ$ = {β$ 1 ,..., β$ p , x$1 ,..., x$ n }. Then the

Materials and methods

covariance matrix of θ$ can be estimated as

Estimating parameters Let two mathematical variables {xi,yi}, i = 1,..., n, be related through some functional relationship yi = f (xi,β), where xi and yi are scalar but β may be a vector of p variables. We are not able to observe xi and yi directly but instead observe the random variables Xi = xi + δi and Yi = yi + εi , where δi and εi are independent normally distributed random variables with mean zero and variances σ2δ and σ2ε , respectively. The minus log likelihood for estimating the n + p unknowns {β1,..., βp, x1,..., xn} is then (Fuller 1987; Seber and Wild 1989): n

(1)

{

}

−L = ∑ [Yi − f (x i, β)]2 兾(2σε2 ) + [X i − x i ]2 兾(2σδ2 ) i =1

+ constant. σ2ε

and σ2δ = σ2ε 兾σ2δ

Because are usually unknown, it is often assumed that the ratio λ is known, and maximum likelihood estimates can be estimated iteratively by minimizing n

(2)

{

}

−2σ2ε L = ∑ [Yi − f (x i, β)]2 + λ[X i − x i ]2 + constant. i =1

It is important to understand that σ2ε and σ2δ are variances of individual observations around some unknown true values. If the functional relationship is the simple line yi = f(xi,β) = β 0 + β1xi, then parameter estimates from least squares will be identical to the usual maximum likelihood parameter estimates given for functional relationship regression coefficients (Kendall and Stuart 1973):

{

}

(3)

2 0. 5 ] β$ 1 = ( s 2y − λ sx2 ) + [( s 2y − λ sx2 ) 2 + 4λ sxy 兾(2 sxy )

(4)

β$ 0 = Y − X β$ 1

where s x2 , s y2 , and sxy are the sample variances and covariance of {Xi,Yi} and X and Y are the sample means. At this point, we need to contrast the functional relationship method, which is parameter estimates given by eq. 2 for any functional relationship f, with the functional relationships estimated for the simple line given by eqs. 3 and 4. The simple line is, of course, only one type of functional relationship that might be fit. However, estimation of the simple line has been at the center of controversy of how measurement error models should be used. The problem boils down to the fact that λ will generally not be known. If we assume λ = 1 in eq. 3, we have the fit called the “major axis.” If we assume λ = s y2 兾s x2 in eq. 3, we have the fit called the “standard (or “reduced”) major axis.” For an interesting discussion concerning the controversy over which of these axes is most generally appropriate, see Jolicoeur (1975, 1990) and Sprent and Dolby (1980). The present author concluded that for functional relationship model fits, a constant value for λ must be assumed (Kimura 1992). Its helpful to understand that if λ is specified, there is little controversy that parameters should be estimated using eq. 2.

Estimating standard errors Because parameters can be estimated using least squares, the standard error of parameter estimates can be estimated using the gra-

(5)

S(θ$) = s$ 2 (Z ′ Z) −1.

In many cases, these usual estimates of the covariance matrix from least squares theory can provide usable, approximate estimates of standard errors. A great advantage of using the least squares estimates of standard errors is this easy generalization to any nonlinear functional relationship model. However, such standard error estimates are technically flawed because they are not statistically consistent. For the simple linear functional relationship, consistent estimates of standard errors are available (Patefield 1977; Fuller 1987). Simulation studies (Kimura 1992) show that for the simple linear model, under ideal conditions, the least squares estimates of standard errors are usually very similar to those provided by Patefield’s (1977) consistent estimates. In an “allometry” example, I compare the least squares and Patefield (1977) estimates of standard error. Although the least squares estimates are convenient, more critical applications may benefit from bootstrap or simulation estimates of standard errors. The simulations may take the form of generic studies of particular models. For example, error variances can be assumed, samples generated, and the least squares standard errors compared with the between-sample standard error of parameter estimates. Bootstrap analysis may be based on residuals of actual model fits. The least squares method was used to provide the standard errors for the models analyzed in this paper.

Testing the equality of functional relationships in K samples A final practical problem that I wish to address is that of testing the equality of functional relationships found in each of K samples. Let k denote the sample subscript, so that we now have K functional relationships that we wish to compare: yki = f (xki ,β k ). Because parameters were estimated with functional relationship regression (i.e., least squares), it would be natural to test the hypothesis H0: β 1 = ... = β K , where the β k s may be p-dimensional vectors, with the residuals from the functional regression least squares fits. Using the “extra sum of squares” principle, we can calculate an F statistic just as in ordinary regression, but using the functional regression residual sum of squares: nk

(6)

SS(k) =

∑ {[Yki − f (x$ki, β$ k)]2 + λ[X ki − x$ki ]2} i =1

with nk – p degrees of freedom. However, simulations with the simple linear model clearly demonstrated (Appendix) that under the null hypothesis of equal regression lines, the resulting F statistic, say F$f , did not always have the expected F distribution. I therefore tried an alternative F statistic by first combining all K samples, assuming a value for λ, and then performing a functional $ x$ ,... , x$ regression fit estimating {β, 11 1 n 1 , x$ 21 ,... , x$ 2 n 2 ,... , x$ K1 ,... , x$ Kn K }. This is the usual functional regression model fit under the null hypothesis. Note that for the simple linear model, both β$ and the {x$ ki } can be estimated in closed form (Appendix). Conditioning on these estimated {x$ ki } (i.e., pretending that these are the usual fixed x values for ordinary nonlinear regression), calculate ordinary re© 2000 NRC Canada

J:\cjfas\cjfas57\cjfas-01\F99-200.vp Friday, January 14, 2000 9:11:42 AM

Color profile: Disabled Composite Default screen

162

Can. J. Fish. Aquat. Sci. Vol. 57, 2000

Table 1. Functional relationship fits of the eastern Bering Sea walleye pollock stock–recruitment data to the Ricker stock– recruitment curve, yi = β 0 xi exp(–β1 xi), for varying values of λ. λ 10 000 2.0

β$ 0

β$ 1

2.7829

0.1356

3.1962

0.1496

1.6

3.8228

1.5

18.7700

1.4 1.3

SE β$ 0 0.834

0.304

0.990

0.033

0.1686

1.242

0.035

0.3425

13.544

0.081

21.0450

0.3544

16.902

0.088

24.8227

0.3714

23.091

0.101

gression coefficients {bk} and the residual sum of squares (SSR) under the null and alternative hypotheses:

SSR(H0) = ∑ [Yki − f (x$ki , b$)] 2 k,i

SSR(HA) = ∑ [Yki − f (x$ki , b$k )] 2 . k,i

For the combined sample, the functional regression coefficients and the conditional ordinary regression coefficients are identical $ because in this case, the least squares expressions to be (i.e., b$ = β) minimized are identical for functional and conditional ordinary regressions. However, for the K individual samples, the estimated functional and conditional ordinary regression coefficients will usually be different. Defining n = Σnk, the degrees of freedom of SSR(H0) and SSR(HA) are n – p and n – Kp, respectively. The sum of squares “due to hypothesis” (SSH) is then SSH = SSR(H0) – SSR(HA) with p(K – 1) degrees of freedom. The F statistic calculated from the residuals of conditional ordinary regressions is then

SSH兾[ p(K − 1)] . SSR(HA)兾[n − Kp]

Simulations (Appendix) show that for the simple linear model, the F statistic based on this conditional ordinary regression F statistic, F$c , has the central F distribution with df1 = p(K – 1) and df2 = n – Kp under the null hypothesis. Because the nonlinear F statistic has been generally useful for testing nonlinear functions using ordinary regression, and because we can show that F$c is useful for testing simple lines estimated by functional relationship regression, we suggest that F$c be generally used to test nonlinear functions estimated by functional relationship regression.

Memory-saving algorithms Although the methods described above are equally valid for large as well as small sample sizes (i.e., n), large sample sizes present computational difficulties because the number of parameters to be estimated is n + p. Therefore, square matrices of size n + p generally need to be calculated by optimization programs. However, when n is large, personal computers will tend to run out of memory. Fortunately, the parameter estimates and their covariance matrix can be calculated by memory-saving methods. First of all, parameter estimates can be estimated using a memorysaving EM-type algorithm. Notice that the sum of squares n

(7)

S(β ,{xi}) = ∑ {[Yi − f (x i, β)] 2 + λ[X i − x i ] 2} i =1

n

∑ {[Yi −

SE β$ 1

Note: Stock–recruitment data and model fits are plotted in Fig. 1.

F$c =

can be minimized by the following. (1) Initially set x$ i = X i . (2) Conditioning on {x$ i }, estimate β$ by minimizing S(β) = i =1

f ( x$ i, β)]2 }, using an interative function minimizing

algorithm. Next, notice that we can reestimate the {x$ i } in eq. 6 one at a $ 2 + λ (X – x$ )2 using time by minimizing S(x$ i ) = (Yi – f (x$ i , β)) i i Newton’s method. (a) We wish to solve h(xi) = S′(xi) = 0. (b) h( x i ) = −2 [Yi − f (β$, x i )] f ′ (β$, x i ) − 2 λ[ X i − x i ] . (c) h ′ ( x i ) = −2 [Yi − f (β$, x i )] f ′′(β$, x i ) + 2 f ′ (β$, x i )2 + 2 λ. The Newton algorithm is xnew = xold – h(xold)/h′(xold). Repeat step 3 until all {x$ i } are reestimated. Repeat steps 2 and 3 until β$ and {x$ i } have converged. The convergence criterion that we used in our example was proportional changes between iterations of less than $ 0.00001 for x$ i and 0.0001 for the components of β. Similar memory problems arise when estimating the covariance matrix of parameter estimates. Fortunately, memory-saving methods are also easily devised for calculating the covariance matrix estimates of the parameter estimates when using the gradient matrix. As described earlier, once β$ has been estimated, the gradient matrix can be described as (3)

G Z = {zij} =  O

D   λ I 

where G is n × p, D is an n × n diagonal matrix, O is an n × p matrix of zeros, and λI is an n × n diagonal matrix with λ on the diagonal. It follows that

 A11 A =  A21 

A12    = Z ′ Z =  G ′ G G ′ D .    ′ ′ + A22  D G D D I λ  

 B11 Let B = A−1 =   B21 

B12  . B22 

An elementary result from matrix algebra is that if A is a positive −1 −1 definite symmetric matrix, then B11 = A11 − A12 A22 A21 . Since the covariance matrix of the parameter estimates is S (β$ ) = s$ 2 B11 , it is possible to make this calculation with no matrices larger than n × p. This is because A22 = D′D + λI is a diagonal matrix that can be inverted simply by inverting its diagonal elements. Furthermore, premultiplying by a diagonal matrix can be accomplished by simply multiplying each row of the target matrix by its corresponding diagonal element.

Results and discussion Model applications We now apply the methods presented in this paper to fit and evaluate three models described by Ricker (1975) and commonly used in fisheries biology: the Ricker stock– recruitment curve, the allometric weight–length relationship, and the von Bertalanffy growth curve. These models were fit to data collected from walleye pollock (Theragra chalcogramma) in the Bering Sea and Gulf of Alaska. The Ricker curve was fit to 1964–1994 stock–recruitment data taken from the eastern Bering Sea. The allometric model and von Bertalanffy growth curve were fit to 1995 samples taken from commercial fisheries in the Gulf of Alaska. These © 2000 NRC Canada

J:\cjfas\cjfas57\cjfas-01\F99-200.vp Friday, January 14, 2000 9:11:43 AM

Color profile: Disabled Composite Default screen

Kimura

163

Fig. 1. Functional relationship fits of eastern Bering Sea walleye pollock stock–recruitment data to the Ricker stock–recruitment curve, yi = β 0 xi exp(–β1 xi), for varying values of λ. Parameter estimates and standard errors are provided in Table 1.

Fig. 2. Overall functional relationship fit of the Gulf of Alaska walleye pollock length–weight data to the allometric curve, yi = β 0 x iβ 1 , where xi is length and yi is weight. Following log transformation, the allometric model becomes linear, log(yi) = log(β 0 ) + β1 log(xi) = β ′0 + β1 log(xi). Data are plotted indicating age-classes, and length and weight were log transformed and assumed to have equal coefficients of variation so that λ = 1. Overall functional relationship regression coefficients and regression coefficients by age-class are provided in Table 2.

© 2000 NRC Canada

J:\cjfas\cjfas57\cjfas-01\F99-200.vp Friday, January 14, 2000 9:11:48 AM

Color profile: Disabled Composite Default screen

164

Can. J. Fish. Aquat. Sci. Vol. 57, 2000 Table 2. Functional relationship fits of the Gulf of Alaska walleye pollock length–weight data to the allometric curve, yi = β 0 x iβ 1 , where xi is length and yi is weight. Age-class

Sample size

β$ 0′

β$ 1

Patefield SE β$ 0′

Patefield SE β$ 1

NLS SE β$ 0′

NLS SE β$ 1

3

25

–14.795

5.033

2.600

0.698

2.557

0.687

4

86

–10.717

3.933

1.419

0.366

1.364

0.352

5

168

–10.168

3.774

0.975

0.249

0.935

0.239

6

365

–10.241

3.780

0.679

0.173

0.650

0.165

7

197

–10.488

3.838

0.869

0.218

0.838

0.211

8

69

–9.256

3.527

1.721

0.429

1.616

0.403

9

41

–3.497

2.081

1.650

0.408

1.381

0.341

10

44

–8.251

3.257

2.543

0.629

2.284

0.565

11

55

–10.046

3.689

1.990

0.490

1.882

0.463

12

8

–5.235

2.514

2.146

0.528

2.074

0.510

All

1058

–8.450

3.325

0.265

0.067

na

na

Note: Data were separated into age-classes, and length and weight were log transformed and assumed to have equal coefficients of variation so that λ = 1. Following log transformation, the allometric model becomes linear, log(yi) = log(β 0) + β 1log(xi) = β 0′ + β 1log(xi). Standard errors were calculated using Patefield’s (1977) consistent estimates and the usual nonlinear least squares (NLS) estimates. The log-transformed data and the overall allometric line are plotted in Fig. 2. na, not available.

Table 3. Functional relationship fits of Gulf of Alaska walleye pollock length-at-age data to the von Bertalanffy growth curve, yi = β 0 [1 – exp(–β1 (xi – β 2 ))], for varying values of λ. β$ 0

β$ 1

β$ 2

SE β$ 0

SE β$ 1

SE β$ 2

10 000

61.097

0.211

–2.920

1.198

0.029

0.745

50

60.794

0.248

–1.725

0.905

0.028

0.517

25

60.948

0.273

–0.966

0.811

0.028

0.449

20

60.869

0.294

–0.522

0.752

0.030

0.419

λ

Note: Methods developed for large sample sizes were used (see text). Age–length data and von Bertalanffy fits are plotted in Fig. 3.

examples were chosen to illustrate different aspects of the methods discussed in this paper. Ricker stock–recruitment curve We use the Ricker stock–recruitment curve to illustrate fitting the basic nonlinear functional relationship using eq. 2 to estimate parameters and eq. 5 to estimate standard errors. The Ricker form of the stock–recruitment curve can be described as yi = β0xi exp(–β1xi), where xi is the number spawning and yi is the number recruited at age 3 years. Because the number of spawners and number of recruits are both difficult to estimate (Walters and Ludwig 1981), it is natural to suspect that both variables contain a great deal of measurement error. We fit this model to eastern Bering Sea walleye pollock population stock–recruitment data (Table 1), assuming λ = 10 000, 2, 1.6, 1.5, 1.4, and 1.3. Recall that λ = 10 000 is equivalent to ordinary nonlinear least squares, since large values of λ assume that there is relatively little error in the Xi variables. The results (Fig. 1; Table 1) illustrate that for ordinary nonlinear least squares (λ = 10 000) down to functional relationship fits with λ = 1.6, the model fits differ only slightly, and for λ = 1.5 down to λ = 1.3, the model fits are again similar. Around λ = 1.527 (i.e., when the measurement error of recruitment is 1.527 times the measurement error of stock size), the fit changes dramatically.

With λ = 1.5, the estimated stock–recruitment curve shows much more compensation than the curve estimated using ordinary regression. Possible factors giving credence to this result are that cannibalism is thought to be an important factor in regulating the walleye pollock population and the population has shown considerable stability under significant fishing pressure. On the other hand, one can argue that there is little direct evidence in the plot (Fig. 1) to support the Ricker curve fit with λ = 1.5, although this result may be due to the existence of large amounts of error in the data. Perhaps the main conclusion from this analysis should be that we cannot dismiss the possibility of significant compensation in the stock– recruitment relationship. Alternatively, Quinn and Deriso (1999) applied a linearized form to fit the Ricker stock–recruitment curve using functional relationship regression. Allometric relationships Allometric relationships are used by biologists for studying ontogenetic changes and the evolutionary relationship between groups of animals. The allometric model is usually described as y i = β0x iβ1 , where xi and yi are two body measurements made on an individual. The data analyst has the choice of fitting the nonlinear relationship directly or mak© 2000 NRC Canada

J:\cjfas\cjfas57\cjfas-01\F99-200.vp Friday, January 14, 2000 9:11:49 AM

Color profile: Disabled Composite Default screen

Kimura

165

Fig. 3. Functional relationship fits of Gulf of Alaska walleye pollock length-at-age data to the von Bertalanffy growth curve, yi = β 0 [1 – exp(–β1 (xi – β 2 ))], for varying values of λ. Methods developed for large sample sizes were used (see text). Parameter estimates and standard errors are provided in Table 3.

Fig. 4. Histogram of residuals for the X variable, X i − x$ i , for the functional relationship fits to the von Bertalanffy growth curve for varying values of λ. Regression coefficients are provided in Table 3 and graphed along with data in Fig. 3.

© 2000 NRC Canada

J:\cjfas\cjfas57\cjfas-01\F99-200.vp Friday, January 14, 2000 9:11:53 AM

Color profile: Disabled Composite Default screen

166

ing a logarithmic transformation and fitting to a straight line. If logarithms are taken, then λ = CVy2兾CVx2 where the CVs are the coefficients of variation (i.e., measurement error or natural variability) of individual measurements. For example, even though length and weight can be accurately determined, obviously the relationship between length and weight will not fall exactly on a curve (i.e., some fish are fat and some are skinny). This is due to what Ricker (1973) called “natural variability,” a combination of genetic and environmental factors. One can think of natural variability as imposing measurement error on “true” unobserved variables, so that it appears reasonable to fit a functional relationship regression model. In contrast, it is common to fit the length–weight relationship simply for the purpose of converting lengths to weights, since measuring lengths of fishes can be much easier than measuring weight. For the purpose of converting length to weight, perhaps ordinary regression is sufficient, since it can be argued that both length and weight can be easily measured with a great deal of accuracy, and one is not concerned about the “true” underlying relationship between length and weight, but only in a mechanism for conversion. We analyze the length–weight functional relationship for Gulf of Alaska walleye pollock, where xi is length and yi is weight, using the log-transformed data with λ = 1. This means that we assume that the coefficient of variation of individual length and weight observations is the same. Because the logarithmic transformation of the allometric model is a simple linear model, log(yi) = log(β 0) + β1log (xi) = β0′ + β1log(xi), the data can be fit using closed-form solutions eqs. 3 and 4. For the simple linear model y i = β 0 + β1x i , the “true” {xi} can be estimated using x$i = [Xi + (Yi β$ 1 – β$ 0 β$ 1) /λ] / [1 + β$ 12 / λ] (Appendix). The question we ask in this analysis is whether the length–weight relationship varies by age. The data were separated into 10 age groups, ages 3–12 years (Fig. 2). The log-transformed data were first fit with all of the age groups combined (Fig. 2). The hypothesis test described earlier was then applied to the problem of whether the allometric line was the same for the 10 age groups. The individual functional relationship lines (Table 2) show what appears to be a smaller slope coefficient β1 for older age fish. This is also evident in the data plots (Fig. 2) where the older age groups (i.e., solid symbols) appear to have a smaller slope than the overall functional relationship line. The test statistic F$c = 6.861, with dfh = 18 and dfe = 1038, indicates that the functional lines are significantly different (P[ F$c > 6.861] ≈ 1.2 × 10−16). In this example, we also compare the least squares estimates of standard error with Patefield’s (1977) consistent estimates (Table 2). Although the least squares estimates are somewhat smaller than Patefield’s (1977) estimates, bias for both estimates is unknown. von Bertalanffy growth Fishery biologists use the von Bertalanffy growth curve almost exclusively to fit length-at-age data to describe the growth of fishes. The most common form of the von Bertalanffy growth curve is yi = β 0[1 – exp(–β1(xi – β 2 ))], where β 0 is the asymptotic size, β1 determines the growth rate, and β 2 is the age at length zero. Because age is difficult to determine in fishes, it is reasonable to consider that the age of fish is known

Can. J. Fish. Aquat. Sci. Vol. 57, 2000

with some measurement error. Also, because the length of each fish of the same “true” age is not identical, we know that length-at-age contains considerable natural variability. The von Bertalanffy growth curve was fit to length-at-age data collected from walleye pollock in the Gulf of Alaska using λ = 10 000, 50, 25, and 20. The large value of λ assumes no measurement error in the ages, while the lesser values assume progressively more ageing error relative to the amount of natural variability in length at age. As in the previous allometry example, the sample sizes are fairly large (in this case, n = 1087). However, in the allometric example, we made a logarithmic transformation so that the model was linear and closed-form parameter estimates were available. In the case of the von Bertalanffy model, we must estimate (β 0, β1, β 2 ) and all {xi} simultaneously for a total of n + p = 1090 parameters. To accomplish this, the memory-saving algorithms described in this paper were used. The results (Table 3; Fig. 3) show that as greater ageing error is assumed in the data, larger values of the growth rate β1 are estimated. This suggests that β1 may be underestimated by not assuming ageing error. One way that we can evaluate the proper range of λ for the model fit is by examining the residuals X i − x$i for different values of λ . The magnitude of the residual will increase as the assumed value of λ decreases (Fig. 4). If λ = 10 000, the residuals are small (Fig. 4A), indicating that the model fit is essentially ordinary regression. If the analyst has evidence that ages are in error ±0.5 year, then λ = 50 seems attractive; if adjustments of ±1.0 year make sense, then λ = 20 or 25 might appear more attractive. Evidence concerning the magnitude of ageing error might come from between-reader estimates of ageing error or comparisons of reader ages with known ages. There is not a great deal of data in the region of the plot where the von Bertalanffy growth curve fits differ (Fig. 3). Nevertheless, this analysis suggests that the seemingly smaller value for β$ 1 estimated using ordinary nonlinear least squares (λ = 10 000) may be due to the presence of ageing error in the data. Conclusions I have shown that least squares methods are available for estimating and interpreting results from nonlinear functional relationship regression. These methods are straightforward, intuitive extensions to ordinary least squares. Whenever a researcher is interested in possible changes in results that might occur if measurement error and (or) natural variability exists in both Xi and Yi, the methods presented here provide easy to apply general methods for exploring these changes. Although the suggested methods appear to perform satisfactorily, advances in statistical theory should eventually provide improved methods for estimating standard errors and testing regression curves. Simulation remains an important tool for evaluating modeling results. For example, simulation can be used to evaluate the validity of the gradient (i.e., least squares) method of estimating standard errors for any particular model.

Acknowledgements I thank Dr. Donald R. Gunderson and Dr. Pierre Jolicoeur © 2000 NRC Canada

J:\cjfas\cjfas57\cjfas-01\F99-200.vp Friday, January 14, 2000 9:11:54 AM

Color profile: Disabled Composite Default screen

Kimura

167

for reviewing this manuscript and providing many helpful comments.

References Fuller, W.A. 1987. Measurement error models. John Wiley & Sons, New York. Hilborn, R., and Walters, C.J. 1992. Quantitative fisheries stock assessment. Chapman and Hall, New York. Jolicoeur, P. 1975. Linear regressions in fishery research: some comments. J. Fish. Res. Board Can. 32: 1491–1494. Jolicoeur, P. 1990. Bivariate allometry: interval estimation of the slopes of ordinary and standardized normal major axes and structural relationship. J. Theor. Biol. 144: 275–285. Kendall, M.G., and Stuart, A. 1973. The advanced theory of statistics. Vol. 2. Hafner Publishing Co., New York. Kimura, D.K. 1992. Symmetry and scale dependence in functional relationship regression. Syst. Biol. 41: 233–241. Patefield, W.M. 1977. On the information matrix in the linear functional relationship problem. Appl. Stat. 26: 69–70. Quinn, T.J., II, and Deriso, R.B. 1999. Quantitative fishery dynamics. Oxford University Press, New York. Ricker, W.E. 1973. Linear regression in fishery research. J. Fish. Res. Board Can. 30: 409–434. Ricker, W.E. 1975. Computation and interpretation of biological statistics of fish populations. Bull. Fish. Res. Board Can. No. 191. Seber, G.A.F., and Wild, C.J. 1989. Nonlinear regression. John Wiley & Sons, New York. Sprent, P., and Dolby, G.R. 1980. The geometric mean functional relationship. Biometrics, 36: 547–550. Walters, C.J., and Ludwig, D. 1981. Effects of measurement errors on the assessment of stock–recruitment relationships. Can. J. Fish. Aquat. Sci. 38: 704–710.

In the Appendix, we examine the problem of testing the equality of several linear regression lines of the form yki = α k + βk xki, k = 1,..., K, i = 1,..., nk. The null hypothesis for the equality of regression lines is H0: α1 = ... = α K and β1 = ... = βK . Although the functional relationships are defined between “true” values (yki, xki), only variables containing error are observable: Xki = xki + δki and Yki = yki + εki . We assume that all δki and εki are independent and normally distributed with variances σ2δ and σ2ε , respectively. Assuming the variance ratio λ = σ2ε 兾σ2δ is known, the maximum likelihood estimates of (α k , βk , xki) are well known (e.g., Graybill 1961, eqs. 9.20–9.22; Kendall and Stuart 1973, eqs. 29.51 and 29.52; Fuller 1987, eqs. 1.3.21, 1.3.27, and 1.3.28): 2 2 2 2 0. 5 ) + [( s 2yk − λ sxk ) + 4λ sxyk ] }兾(2 sxyk ) β$ k = {( s 2yk − λ sxk

α$ k = Yk − X k β$ k x$ki = [X ki + (Yki β$ k − α$ k β$ k )兾λ]兾[1 + β$ 2k 兾λ]. 2 The quantities (X k , Yk , sxk , s 2yk , sxyk ) are simply the sample means, variances, and covariance of the observed (Xki,Yki) calculated for the kth sample. Fuller’s (1987) results are somewhat more general, allowing for covariance between εki and δki .

The maximum likelihood estimates for the functional relationship model with λ known can also be estimated by minimizing the residual sum of squares for the model fit over both the X and Y variables (Graybill 1961, sect. 9.2.2; Fuller 1987, sect. 1.3.3; Kimura 1992a, 1992b): SSF(k) = ∑ {(Yki − y$ki) 2 + λ(X ki − x$ki) 2}. i

It can be noted that the residual degrees of freedom are the same as for ordinary regression (i.e., nk – 2) because while the number of observations is 2nk, the number of parameters in the model increases to 2 + nk. The question we pose is how do we test the hypothesis of equal functional regression lines? Using the analogy of ordinary least squares, it is inviting to calculate an F statistic using the extra sum of squares principle (Draper and Smith 1981), but using the functional regression residual sum of squares described above: SSF(H0) = ∑ {[Yki − (α$ + β$ x$ki)]2 + λ[X ki − x$ki ]2} k,i

SSF(HA) = ∑ {[Yki − (α$ k + β$ k x$ki)]2 + λ[X ki − x$ki ]2} . k,i

$ x$ ,..., x$ , $ β, Recall that the minimization of SSF(H0) is over {α, 11 1n 1

x$21,..., x$2 n2 ,..., x$K1,..., x$KnK } and the minimization of SSF(HA) is over {α$ 1, β$1,..., α$ K , β$ K , x$11,..., x$1n1 , x$21,..., x$2 n2 ,..., x$K1,..., x$KnK } so that the estimated x$ki are different under SSF(H0) and SSF(HA). Defining n = Σ nk, the degrees of freedom of SSF(H0) and SSF(HA) are n – 2 and n – 2K, respectively. The sum of squares due to hypothesis is then SSFH = SSF(H0) – SSF(HA) with 2(K – 1) degrees of freedom. The F statistic calculated from the residuals of functional regressions is then F$f =

SSFH兾[2(K − 1)] . SSF(HA)兾[n − 2K ]

However, under the null hypothesis of equal regression lines, the resulting F statistic, F$f , does not always have a distribution well approximated by the central F distribution. The reason for this may be that the reestimation of the {xki} under the alternative hypotheses prevents a proper orthogonal decomposition of the sum of squares required for the F distribution. Under the classic derivation of the F statistic (Scheffe 1959, sect. 2.9), the sums of squares are squared norms of projections made onto the column space spanned by the observed X data. Under ordinary regression, these X values are constants. With this idea in mind, I tried an alternative F statistic. First, combine all of the sample data (i.e., all samples), assume a value for λ, and perform a functional regression fit $ x$ ,..., x$ , x$ ,..., x$ $ β, estimating {α, 11 1n1 21 2 n2 ,..., x$K1,..., x$KnK }. This is the usual functional regression model fit under the null hypothesis. Conditioning on these estimated {x$ki } (i.e., pretending that these are the usual fixed x values for ordinary regression), calculate ordinary regression coefficients (a, b) and the residual sum of squares under the null and alternative hypotheses: © 2000 NRC Canada

J:\cjfas\cjfas57\cjfas-01\F99-200.vp Friday, January 14, 2000 9:11:55 AM

Color profile: Disabled Composite Default screen

168

Can. J. Fish. Aquat. Sci. Vol. 57, 2000

Fig. A1. Comparisons of distribution of simulated F tests, Ff and Fc, under the null hypothesis of equal regression lines for λ = 1.0 (σ2ε = 400, σ2δ = 400) and n1 = n2 = 10. The plots assume σ2x = 1, 100, 400, and 900.

SSC(H0) = ∑ [Yki − (a$ + b$ x$ki)] 2 k,i

SSC (HA) = ∑ [Yki − (a$ k + b$k x$ki)]2 . k,i

It is intuitively important to note that for the combined sample, the functional regression coefficients and the conditional ordinary regression coefficients are identical (i.e., a$ = α$ and $ This is because maximum likelihood estimates {α $ $ , β} b$ = β). can be viewed as the maximization step of the EM algorithm (Kimura 1992b), which is precisely this conditional ordinary regression. However, for individual samples, the estimated functional and conditional ordinary regression coefficients will generally be different (i.e., a$ k ≠ α$ k and b$k ≠ β$ k ). Again, the degrees of freedom of SSC(H0) and SSC(HA) are n – 2 and n – 2K, respectively. The sum of squares due to hypothesis is then SSCH = SSC(H0) – SSC(HA) with 2(K – 1) degrees of freedom. The F statistic calculated from the residuals of conditional ordinary regressions is then F$c =

SSCH兾[2(K − 1)] . SSC (HA)兾[n − 2K ]

Simulations We performed a variety of simulations to examine the be-

havior of F$f and F$c under different circumstances. All simulations assumed K = 2 but varied the following. (1) λ = σ2ε 兾σ2δ : (a) λ = 100 (σ2ε = 400, σ2δ = 4), (b) λ = 1.0 (σ2ε = 400, σ2δ = 400), (c) λ = 0.01(σ2ε = 4, σ2δ = 400). (2) Sample sizes nk: (a) n1 = n2 = 3, (b) n1 = n2 = 10, (c) n1 = n2 = 25. (3) Var(x ij ) = σ2x : (A) σ2x = 0.1, (b) σ2x = 1.0, (c) σ2x = 100, (d) σ2x = 400, (e) σ2x = 900, (f) σ2x = 10 000. (4) Simulations under the null hypothesis of equal regression lines assumed (a) (α1 = 0.0, β1 = 0.25; α 2 = 0.0, β 2 = 0.25), (b) (α1 = 0.0, β1 = 1.0; α 2 = 0.0, β 2 = 1.0), (c) (α1 = 0.0, β1 = 1000; α 2 = 0.0, β 2 = 1000). Each simulation was repeated 10 000 times, and measurement errors and true x values were assumed to be normally distributed with a mean of zero. This variability in x values is in accordance with the “structural relationship” model (Kendall and Stuart 1973, sect. 29.6). Simulation 1 Assumed 1abc, 2b, 3bcde, 4b. The purpose of this simulation is to show the null distribution of F$f and F$c for varying λ and σ2x . Simulation 2 Assumed 1b, 2ac, 3af, 4ac. The purpose of this simulation © 2000 NRC Canada

J:\cjfas\cjfas57\cjfas-01\F99-200.vp Friday, January 14, 2000 9:11:58 AM

Color profile: Disabled Composite Default screen

Kimura

169

Fig. A2. Comparisons of distribution of simulated F tests, Ff and Fc, under the null hypothesis of equal regression lines for λ = 100 (σ 2ε = 400, σ 2δ = 4) and n1 = n2 = 10. The plots assume σ 2x = 1, 100, 400, and 900. These plots are identical to the plots for λ = 0.01 (σ 2ε = 4 , σ 2δ = 400), which implies a symmetry for the distribution of Ff under the null hypothesis.

Table A1. Simulated type I error rates (α) for the Ff and Fc statistics compared with values predicted from the central F distribution. n1, n2

σ2x

β

Nominal α

P [ F$f > F1 − α ]

P [ F$c > F1 − α ]

3

0.1

0.25

0.10

0.1656

0.1008

0.05

0.0851

0.0523

0.01

0.0172

0.0106

0.10

0.0975

0.0951

0.05

0.0470

0.0458

0.01

0.0098

0.0097

0.10

0.1100

0.0987

0.05

0.0552

0.0487

0.01

0.0114

0.0101

0.10

0.0960

0.0960

0.05

0.0478

0.0478

0.01

0.0101

0.0101

3

3

3

0.1

10 000

10 000

1000

0.25

1000

© 2000 NRC Canada

J:\cjfas\cjfas57\cjfas-01\F99-200.vp Friday, January 14, 2000 9:12:01 AM

Color profile: Disabled Composite Default screen

170

Can. J. Fish. Aquat. Sci. Vol. 57, 2000 Table A1 (concluded). n1, n2

σ2x

β

Nominal α

P [ F$f > F1 − α ]

P [ F$c > F1 − α ]

25

0.1

0.25

0.10

0.4669

0.1016

0.05

0.3607

0.0517

0.01

0.1851

0.0098

0.10

0.0985

0.0981

0.05

0.0473

0.0472

0.01

0.0095

0.0092

0.10

0.1085

0.1039

0.05

0.0543

0.0513

0.01

0.0125

0.0115

0.10

0.1040

0.1040

0.05

0.0486

0.0486

0.01

0.0099

0.0099

25

25

25

0.1

10 000

10 000

1000

0.25

1000

Note: All simulations assumed λ = 1.0 value of ni, σ 2x , and β.

(σ 2ε

= 400,

was to examine the null distribution of F$f and F$c under a variety of conditions. Generally, I tried to examine two extreme levels of sample size (n1 = n2 = 3–25), σ2x = 0.1 – 10 000, and β = 0.25–1000. These were arranged as a 23 factorial design. Simulation results Results from simulation 1 (Figs. A1 and A2) indicate that for varying λ and σ2x (i.e., spreads in true x values), the distribution of F$c under the null hypothesis of equal regression lines is well approximated by the central F distribution. These simulations also indicate that the null distribution of F$f can be poorly approximated (i.e., excessive type I error) by the central F distribution, especially when σ2x is very small (assumption 3b). However, when there is substantial measurement error in both X and Y, the poor approximation might occur even if σ2x > σ2ε and σ2x > σ2δ . Finally, simulation 2 was designed to explore conditions where the F statistics might fail to have the central F distribution under the null hypothesis. For brevity, I examined simulated type I error rates at the α = 0.10, 0.05, and 0.01 levels. Table A1 shows that Fc followed the central F distribution at all levels of the simulation. The Ff also performed quite well except when σ2x and β were both small. Sample size, nk, did not seem to matter.

σ 2δ

= 400) and were replicated 10 000 times for each

From these simulations, we recommend that the hypothesis of equal lines for functional relationships be tested using the Fc statistic. This statistic appears to generally have the correct F distribution even when the spread in x values is very small. Caution should be used when applying the Ff statistic. Under the null hypothesis, simulations show that Ff can have inflated type I error rates even when variability in x exceeds measurement errors. Variability should be evaluated if the Ff statistic is to be used. Appendix References Draper, N.R., and Smith, H. 1981. Applied regression analysis. 2nd ed. John Wiley & Sons, New York. Fuller, W.A. 1987. Measurement error models. John Wiley & Sons, New York. Graybill, F.A. 1961. An introduction to linear models. Vol. I. McGrawHill, New York. Kendall, M.G., and Stuart, A. 1973. The advanced theory of statistics. Vol. 2. Hafner Publishing Co., New York. Kimura, D.K. 1992a. Symmetry and scale dependence in functional relationship regression. Syst. Biol. 41: 233–241. Kimura, D.K. 1992b. Functional comparative calibration using an EM algorithm. Biometrics, 48: 1263–1271. Scheffe, H. 1959. The analysis of variance. John Wiley & Sons, New York.

© 2000 NRC Canada

J:\cjfas\cjfas57\cjfas-01\F99-200.vp Friday, January 14, 2000 9:12:02 AM