Skip to contents

residuals

Usage

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

Examples

data(ple4)
fit <- rlnorm(1, log(catch(ple4)), 0.1)
residuals(catch(ple4), fit)
#> An object of class "FLQuant"
#> , , unit = unique, season = all, area = unique
#> 
#>      year
#> age   1957       1958       1959       1960       1961       1962      
#>   all -0.0108789 -0.0589731  0.0043977  0.1686388  0.0552120 -0.0281764
#>      year
#> age   1963       1964       1965       1966       1967       1968      
#>   all  0.1230334 -0.1588650  0.1178664 -0.0533698  0.2165916  0.0444650
#>      year
#> age   1969       1970       1971       1972       1973       1974      
#>   all  0.1146472 -0.0569631  0.0340476 -0.1488198 -0.0871604  0.0893161
#>      year
#> age   1975       1976       1977       1978       1979       1980      
#>   all  0.0820421 -0.1366244  0.1660949 -0.1495924 -0.1057146  0.1078429
#>      year
#> age   1981       1982       1983       1984       1985       1986      
#>   all  0.0716095 -0.0749412  0.1019636  0.1266241 -0.0059314 -0.0064608
#>      year
#> age   1987       1988       1989       1990       1991       1992      
#>   all  0.0939218  0.1281953  0.0546810  0.0121466 -0.0518721  0.0422410
#>      year
#> age   1993       1994       1995       1996       1997       1998      
#>   all  0.0915435  0.0114923 -0.1623184  0.0558999 -0.0717652  0.1263555
#>      year
#> age   1999       2000       2001       2002       2003       2004      
#>   all  0.2495706 -0.1567068  0.1268930 -0.1281268  0.0426292 -0.1292239
#>      year
#> age   2005       2006       2007       2008       2009       2010      
#>   all -0.0687038 -0.0750960 -0.0980274 -0.0130738  0.0549904 -0.1086788
#>      year
#> age   2011       2012       2013       2014       2015       2016      
#>   all  0.1060384  0.0137913 -0.0438652  0.1281073  0.0811740  0.1201914
#>      year
#> age   2017      
#>   all  0.0176347
#> 
#> units:  t 
residuals(catch(ple4), fit, type="student")
#> An object of class "FLQuant"
#> , , unit = unique, season = all, area = unique
#> 
#>      year
#> age   1957       1958       1959       1960       1961       1962      
#>   all  0.3684981  0.2952185  0.2251625  0.2127320  0.1596261  0.0880482
#>      year
#> age   1963       1964       1965       1966       1967       1968      
#>   all  0.0674997 -0.0211240  0.0235204  0.0026447  0.0229652  0.0170615
#>      year
#> age   1969       1970       1971       1972       1973       1974      
#>   all  0.0421306  0.0314899  0.0424563 -0.0188638 -0.0074573  0.0039738
#>      year
#> age   1975       1976       1977       1978       1979       1980      
#>   all -0.0031742  0.0856788 -0.0110329  0.1117918  0.0516109  0.0257718
#>      year
#> age   1981       1982       1983       1984       1985       1986      
#>   all  0.0445782  0.2210007  0.2750476  0.4861785  1.4095564  2.9683767
#>      year
#> age   1987       1988       1989       1990       1991       1992      
#>   all  4.0807817  4.2365213  3.3127507  1.4723064  0.6576836  0.1209183
#>      year
#> age   1993       1994       1995       1996       1997       1998      
#>   all  0.0149143  0.0085550  0.0049861  0.0920652 -0.0052623 -0.0092081
#>      year
#> age   1999       2000       2001       2002       2003       2004      
#>   all -0.0311314 -0.0200036  0.1362068 -0.0098510  0.0075256 -0.0031891
#>      year
#> age   2005       2006       2007       2008       2009       2010      
#>   all  0.1348259  0.1477090  0.1798691  0.1672035  0.1825749  0.0916176
#>      year
#> age   2011       2012       2013       2014       2015       2016      
#>   all  0.1785514  0.0765191  0.0209775  0.0739139  0.0724932  0.1163009
#>      year
#> age   2017      
#>   all  0.1137737
#> 
#> units:   
rraw(catch(ple4), fit)
#> An object of class "FLQuant"
#> , , unit = unique, season = all, area = unique
#> 
#>      year
#> age   1957      1958      1959      1960      1961      1962      1963     
#>   all   -857.13  -5393.41    461.56  18308.00   6421.19  -3609.01  16301.52
#>      year
#> age   1964      1965      1966      1967      1968      1969      1970     
#>   all -25403.41  16834.30  -8895.40  30082.49   6515.82  15833.86  -8008.18
#>      year
#> age   1971      1972      1973      1974      1975      1976      1977     
#>   all   4727.48 -23971.67 -13798.71  13499.56  13027.40 -25748.59  25379.66
#>      year
#> age   1978      1979      1980      1981      1982      1983      1984     
#>   all -28748.94 -19251.51  18881.15  12749.58 -14975.76  20612.00  27148.77
#>      year
#> age   1985      1986      1987      1988      1989      1990      1991     
#>   all  -1469.83  -1809.87  27654.00  37929.74  15540.02   3025.58 -11616.34
#>      year
#> age   1992      1993      1994      1995      1996      1997      1998     
#>   all   7969.97  15708.76   1728.24 -23373.75   7161.07 -11323.74  20325.95
#>      year
#> age   1999      2000      2001      2002      2003      2004      2005     
#>   all  37693.24 -24768.93  15266.75 -19658.05   6428.16 -19320.06  -8146.72
#>      year
#> age   2006      2007      2008      2009      2010      2011      2012     
#>   all  -8724.02 -10790.58  -1492.26   6190.75 -13641.52  12044.82   1806.19
#>      year
#> age   2013      2014      2015      2016      2017     
#>   all  -6325.14  16803.70  10707.83  14860.14   2183.64
#> 
#> units:  t 
rlogstandard(catch(ple4), fit)
#> An object of class "FLQuant"
#> , , unit = unique, season = all, area = unique
#> 
#>      year
#> age   1957      1958      1959      1960      1961      1962      1963     
#>   all -0.105966 -0.574427  0.042836  1.642626  0.537792 -0.274452  1.198406
#>      year
#> age   1964      1965      1966      1967      1968      1969      1970     
#>   all -1.547424  1.148077 -0.519849  2.109709  0.433111  1.116721 -0.554849
#>      year
#> age   1971      1972      1973      1974      1975      1976      1977     
#>   all  0.331641 -1.449578 -0.848985  0.869983  0.799131 -1.330789  1.617846
#>      year
#> age   1978      1979      1980      1981      1982      1983      1984     
#>   all -1.457103 -1.029712  1.050443  0.697512 -0.729964  0.993175  1.233381
#>      year
#> age   1985      1986      1987      1988      1989      1990      1991     
#>   all -0.057774 -0.062931  0.914845  1.248685  0.532620  0.118314 -0.505260
#>      year
#> age   1992      1993      1994      1995      1996      1997      1998     
#>   all  0.411449  0.891679  0.111941 -1.581061  0.544492 -0.699028  1.230765
#>      year
#> age   1999      2000      2001      2002      2003      2004      2005     
#>   all  2.430940 -1.526401  1.236001 -1.248018  0.415229 -1.258704 -0.669209
#>      year
#> age   2006      2007      2008      2009      2010      2011      2012     
#>   all -0.731472 -0.954836 -0.127346  0.535634 -1.058585  1.032866  0.134334
#>      year
#> age   2013      2014      2015      2016      2017     
#>   all -0.427269  1.247829  0.790675  1.170724  0.171770
#> 
#> units:   
rstandard(catch(ple4), fit)
#> An object of class "FLQuant"
#> , , unit = unique, season = all, area = unique
#> 
#>      year
#> age   1957    1958    1959    1960    1961    1962    1963    1964    1965   
#>   all  9.4504  9.0066  9.5959 11.3087 10.0961  9.2883 10.8046  8.1504 10.7489
#>      year
#> age   1966    1967    1968    1969    1970    1971    1972    1973    1974   
#>   all  9.0573 11.8642  9.9882 10.7143  9.0248  9.8847  8.2327  8.7563 10.4463
#>      year
#> age   1975    1976    1977    1978    1979    1980    1981    1982    1983   
#>   all 10.3706  8.3337 11.2800  8.2264  8.5953 10.6417 10.2630  8.8640 10.5793
#>      year
#> age   1984    1985    1986    1987    1988    1989    1990    1991    1992   
#>   all 10.8434  9.4973  9.4922 10.4946 10.8605 10.0907  9.6705  9.0708  9.9660
#>      year
#> age   1993    1994    1995    1996    1997    1998    1999    2000    2001   
#>   all 10.4696  9.6642  8.1223 10.1030  8.8922 10.8405 12.2620  8.1680 10.8463
#>      year
#> age   2002    2003    2004    2005    2006    2007    2008    2009    2010   
#>   all  8.4048  9.9698  8.3956  8.9194  8.8626  8.6617  9.4297 10.0938  8.5699
#>      year
#> age   2011    2012    2013    2014    2015    2016    2017   
#>   all 10.6225  9.6864  9.1437 10.8595 10.3616 10.7739  9.7237
#> 
#> units:   
rstudent(catch(ple4), fit)
#> An object of class "FLQuant"
#> , , unit = unique, season = all, area = unique
#> 
#>      year
#> age   1957       1958       1959       1960       1961       1962      
#>   all  0.3684981  0.2952185  0.2251625  0.2127320  0.1596261  0.0880482
#>      year
#> age   1963       1964       1965       1966       1967       1968      
#>   all  0.0674997 -0.0211240  0.0235204  0.0026447  0.0229652  0.0170615
#>      year
#> age   1969       1970       1971       1972       1973       1974      
#>   all  0.0421306  0.0314899  0.0424563 -0.0188638 -0.0074573  0.0039738
#>      year
#> age   1975       1976       1977       1978       1979       1980      
#>   all -0.0031742  0.0856788 -0.0110329  0.1117918  0.0516109  0.0257718
#>      year
#> age   1981       1982       1983       1984       1985       1986      
#>   all  0.0445782  0.2210007  0.2750476  0.4861785  1.4095564  2.9683767
#>      year
#> age   1987       1988       1989       1990       1991       1992      
#>   all  4.0807817  4.2365213  3.3127507  1.4723064  0.6576836  0.1209183
#>      year
#> age   1993       1994       1995       1996       1997       1998      
#>   all  0.0149143  0.0085550  0.0049861  0.0920652 -0.0052623 -0.0092081
#>      year
#> age   1999       2000       2001       2002       2003       2004      
#>   all -0.0311314 -0.0200036  0.1362068 -0.0098510  0.0075256 -0.0031891
#>      year
#> age   2005       2006       2007       2008       2009       2010      
#>   all  0.1348259  0.1477090  0.1798691  0.1672035  0.1825749  0.0916176
#>      year
#> age   2011       2012       2013       2014       2015       2016      
#>   all  0.1785514  0.0765191  0.0209775  0.0739139  0.0724932  0.1163009
#>      year
#> age   2017      
#>   all  0.1137737
#> 
#> units: