Skip to contents

residuals

Usage

# S4 method for class 'FLQuant'
residuals(object, fit, type = "log", ...)

Examples

data(ple4)
fit <- rlnorm(1, log(catch(ple4)), 0.1)
residuals(catch(ple4), fit)
#> An x of class "FLQuant"
#> , , unit = unique, season = all, area = unique
#> 
#>      year
#> age   1957     1958     1959     1960     1961     1962     1963     1964    
#>   all -0.01088 -0.05897  0.00440  0.16864  0.05521 -0.02818  0.12303 -0.15887
#>      year
#> age   1965     1966     1967     1968     1969     1970     1971     1972    
#>   all  0.11787 -0.05337  0.21659  0.04447  0.11465 -0.05696  0.03405 -0.14882
#>      year
#> age   1973     1974     1975     1976     1977     1978     1979     1980    
#>   all -0.08716  0.08932  0.08204 -0.13662  0.16609 -0.14959 -0.10571  0.10784
#>      year
#> age   1981     1982     1983     1984     1985     1986     1987     1988    
#>   all  0.07161 -0.07494  0.10196  0.12662 -0.00593 -0.00646  0.09392  0.12820
#>      year
#> age   1989     1990     1991     1992     1993     1994     1995     1996    
#>   all  0.05468  0.01215 -0.05187  0.04224  0.09154  0.01149 -0.16232  0.05590
#>      year
#> age   1997     1998     1999     2000     2001     2002     2003     2004    
#>   all -0.07177  0.12636  0.24957 -0.15671  0.12689 -0.12813  0.04263 -0.12922
#>      year
#> age   2005     2006     2007     2008     2009     2010     2011     2012    
#>   all -0.06870 -0.07510 -0.09803 -0.01307  0.05499 -0.10868  0.10604  0.01379
#>      year
#> age   2013     2014     2015     2016     2017    
#>   all -0.04387  0.12811  0.08117  0.12019  0.01763
#> 
#> units:  t 
residuals(catch(ple4), fit, type="student")
#> An x of class "FLQuant"
#> , , unit = unique, season = all, area = unique
#> 
#>      year
#> age   1957     1958     1959     1960     1961     1962     1963     1964    
#>   all  0.36850  0.29522  0.22516  0.21273  0.15963  0.08805  0.06750 -0.02112
#>      year
#> age   1965     1966     1967     1968     1969     1970     1971     1972    
#>   all  0.02352  0.00264  0.02297  0.01706  0.04213  0.03149  0.04246 -0.01886
#>      year
#> age   1973     1974     1975     1976     1977     1978     1979     1980    
#>   all -0.00746  0.00397 -0.00317  0.08568 -0.01103  0.11179  0.05161  0.02577
#>      year
#> age   1981     1982     1983     1984     1985     1986     1987     1988    
#>   all  0.04458  0.22100  0.27505  0.48618  1.40956  2.96838  4.08078  4.23652
#>      year
#> age   1989     1990     1991     1992     1993     1994     1995     1996    
#>   all  3.31275  1.47231  0.65768  0.12092  0.01491  0.00855  0.00499  0.09207
#>      year
#> age   1997     1998     1999     2000     2001     2002     2003     2004    
#>   all -0.00526 -0.00921 -0.03113 -0.02000  0.13621 -0.00985  0.00753 -0.00319
#>      year
#> age   2005     2006     2007     2008     2009     2010     2011     2012    
#>   all  0.13483  0.14771  0.17987  0.16720  0.18257  0.09162  0.17855  0.07652
#>      year
#> age   2013     2014     2015     2016     2017    
#>   all  0.02098  0.07391  0.07249  0.11630  0.11377
#> 
#> units:   
rraw(catch(ple4), fit)
#> An x of class "FLQuant"
#> , , unit = unique, season = all, area = unique
#> 
#>      year
#> age   1957   1958   1959   1960   1961   1962   1963   1964   1965   1966  
#>   all   -857  -5393    462  18308   6421  -3609  16302 -25403  16834  -8895
#>      year
#> age   1967   1968   1969   1970   1971   1972   1973   1974   1975   1976  
#>   all  30082   6516  15834  -8008   4727 -23972 -13799  13500  13027 -25749
#>      year
#> age   1977   1978   1979   1980   1981   1982   1983   1984   1985   1986  
#>   all  25380 -28749 -19252  18881  12750 -14976  20612  27149  -1470  -1810
#>      year
#> age   1987   1988   1989   1990   1991   1992   1993   1994   1995   1996  
#>   all  27654  37930  15540   3026 -11616   7970  15709   1728 -23374   7161
#>      year
#> age   1997   1998   1999   2000   2001   2002   2003   2004   2005   2006  
#>   all -11324  20326  37693 -24769  15267 -19658   6428 -19320  -8147  -8724
#>      year
#> age   2007   2008   2009   2010   2011   2012   2013   2014   2015   2016  
#>   all -10791  -1492   6191 -13642  12045   1806  -6325  16804  10708  14860
#>      year
#> age   2017  
#>   all   2184
#> 
#> units:  t 
rlogstandard(catch(ple4), fit)
#> An x of class "FLQuant"
#> , , unit = unique, season = all, area = unique
#> 
#>      year
#> age   1957    1958    1959    1960    1961    1962    1963    1964    1965   
#>   all -0.1060 -0.5744  0.0428  1.6426  0.5378 -0.2745  1.1984 -1.5474  1.1481
#>      year
#> age   1966    1967    1968    1969    1970    1971    1972    1973    1974   
#>   all -0.5198  2.1097  0.4331  1.1167 -0.5548  0.3316 -1.4496 -0.8490  0.8700
#>      year
#> age   1975    1976    1977    1978    1979    1980    1981    1982    1983   
#>   all  0.7991 -1.3308  1.6178 -1.4571 -1.0297  1.0504  0.6975 -0.7300  0.9932
#>      year
#> age   1984    1985    1986    1987    1988    1989    1990    1991    1992   
#>   all  1.2334 -0.0578 -0.0629  0.9148  1.2487  0.5326  0.1183 -0.5053  0.4114
#>      year
#> age   1993    1994    1995    1996    1997    1998    1999    2000    2001   
#>   all  0.8917  0.1119 -1.5811  0.5445 -0.6990  1.2308  2.4309 -1.5264  1.2360
#>      year
#> age   2002    2003    2004    2005    2006    2007    2008    2009    2010   
#>   all -1.2480  0.4152 -1.2587 -0.6692 -0.7315 -0.9548 -0.1273  0.5356 -1.0586
#>      year
#> age   2011    2012    2013    2014    2015    2016    2017   
#>   all  1.0329  0.1343 -0.4273  1.2478  0.7907  1.1707  0.1718
#> 
#> units:   
rstandard(catch(ple4), fit)
#> An x of class "FLQuant"
#> , , unit = unique, season = all, area = unique
#> 
#>      year
#> age   1957  1958  1959  1960  1961  1962  1963  1964  1965  1966  1967  1968 
#>   all  9.45  9.01  9.60 11.31 10.10  9.29 10.80  8.15 10.75  9.06 11.86  9.99
#>      year
#> age   1969  1970  1971  1972  1973  1974  1975  1976  1977  1978  1979  1980 
#>   all 10.71  9.02  9.88  8.23  8.76 10.45 10.37  8.33 11.28  8.23  8.60 10.64
#>      year
#> age   1981  1982  1983  1984  1985  1986  1987  1988  1989  1990  1991  1992 
#>   all 10.26  8.86 10.58 10.84  9.50  9.49 10.49 10.86 10.09  9.67  9.07  9.97
#>      year
#> age   1993  1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004 
#>   all 10.47  9.66  8.12 10.10  8.89 10.84 12.26  8.17 10.85  8.40  9.97  8.40
#>      year
#> age   2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016 
#>   all  8.92  8.86  8.66  9.43 10.09  8.57 10.62  9.69  9.14 10.86 10.36 10.77
#>      year
#> age   2017 
#>   all  9.72
#> 
#> units:   
rstudent(catch(ple4), fit)
#> An x of class "FLQuant"
#> , , unit = unique, season = all, area = unique
#> 
#>      year
#> age   1957     1958     1959     1960     1961     1962     1963     1964    
#>   all  0.36850  0.29522  0.22516  0.21273  0.15963  0.08805  0.06750 -0.02112
#>      year
#> age   1965     1966     1967     1968     1969     1970     1971     1972    
#>   all  0.02352  0.00264  0.02297  0.01706  0.04213  0.03149  0.04246 -0.01886
#>      year
#> age   1973     1974     1975     1976     1977     1978     1979     1980    
#>   all -0.00746  0.00397 -0.00317  0.08568 -0.01103  0.11179  0.05161  0.02577
#>      year
#> age   1981     1982     1983     1984     1985     1986     1987     1988    
#>   all  0.04458  0.22100  0.27505  0.48618  1.40956  2.96838  4.08078  4.23652
#>      year
#> age   1989     1990     1991     1992     1993     1994     1995     1996    
#>   all  3.31275  1.47231  0.65768  0.12092  0.01491  0.00855  0.00499  0.09207
#>      year
#> age   1997     1998     1999     2000     2001     2002     2003     2004    
#>   all -0.00526 -0.00921 -0.03113 -0.02000  0.13621 -0.00985  0.00753 -0.00319
#>      year
#> age   2005     2006     2007     2008     2009     2010     2011     2012    
#>   all  0.13483  0.14771  0.17987  0.16720  0.18257  0.09162  0.17855  0.07652
#>      year
#> age   2013     2014     2015     2016     2017    
#>   all  0.02098  0.07391  0.07249  0.11630  0.11377
#> 
#> units: