Skip to contents

Generic function to compute the variance and standard deviations. The default uses stats::var() and stats::sd().

Usage

sd(object, ...)

# Default S3 method
sd(object, ...)

# S3 method for class 'dfts'
sd(object, type = "pointwise", ...)

var(object, ...)

# Default S3 method
var(object, ...)

# S3 method for class 'dfts'
var(object, type = c("operator", "pointwise"), ...)

Arguments

object

Object for computation of standard deviation or variance of the given data set.

...

Additional parameters for the particular extensions.

type

String to specify if an operator ('op') or pointwise ('pw') calculation is desired on the functional data.

Value

Numeric(s) to explain the standard deviation / variance

Examples

sd(1:10)
#> [1] 3.02765
var(1:10)
#> [1] 9.166667
sd(electricity,type='pointwise')
#>  [1] 16.35713 16.34201 16.39898 16.47707 16.33269 16.13200 16.97070 17.73917
#>  [9] 18.54756 18.47440 18.10570 18.18850 18.20834 18.24674 18.01622 18.07915
#> [17] 18.50953 18.32770 17.73067 17.50302 17.26738 16.09757 15.67295 15.62891
var(electricity,type='pointwise')
#>  [1] 267.5556 267.0614 268.9267 271.4940 266.7568 260.2413 288.0047 314.6783
#>  [9] 344.0118 341.3035 327.8163 330.8216 331.5437 332.9434 324.5842 326.8555
#> [17] 342.6026 335.9044 314.3766 306.3559 298.1623 259.1318 245.6414 244.2629
var(electricity,type='operator')
#>           [,1]     [,2]     [,3]     [,4]     [,5]     [,6]     [,7]     [,8]
#>  [1,] 266.8226 258.3463 251.2251 249.8657 244.1265 241.6963 249.2290 231.1259
#>  [2,] 258.3463 266.3297 262.2927 260.8044 255.6677 253.0834 258.3323 232.7066
#>  [3,] 251.2251 262.2927 268.1899 266.9947 262.7752 258.0742 259.1404 227.4958
#>  [4,] 249.8657 260.8044 266.9947 270.7501 267.0062 261.2326 261.3174 228.4781
#>  [5,] 244.1265 255.6677 262.7752 267.0062 266.0259 259.9783 260.0942 228.3761
#>  [6,] 241.6963 253.0834 258.0742 261.2326 259.9783 259.5283 264.7307 240.0232
#>  [7,] 249.2290 258.3323 259.1404 261.3174 260.0942 264.7307 287.2156 276.0245
#>  [8,] 231.1259 232.7066 227.4958 228.4781 228.3761 240.0232 276.0245 313.8162
#>  [9,] 226.3456 228.4487 222.1118 223.8089 223.8012 237.6298 278.0906 322.7289
#> [10,] 219.8945 219.7326 212.3350 213.4931 212.9526 226.6528 266.3497 314.3064
#> [11,] 228.1157 226.8837 219.6527 219.8745 218.6856 230.6395 266.6847 307.0494
#> [12,] 234.2608 233.5810 227.0882 227.3861 226.3003 237.4389 271.1360 307.0040
#> [13,] 231.2138 229.5075 223.0144 222.9140 221.9454 233.6443 267.3881 305.0501
#> [14,] 233.9530 233.1102 227.7527 228.1423 227.1469 238.0900 269.8659 303.5704
#> [15,] 230.1144 229.1858 223.5811 223.9115 223.2323 233.9177 264.0867 296.4667
#> [16,] 226.0504 226.0130 220.9978 221.6211 221.4165 233.0184 264.5560 297.1976
#> [17,] 222.8072 222.4622 217.3451 218.1453 218.0121 230.8193 264.1622 300.0173
#> [18,] 209.8491 206.6692 199.7570 199.8573 199.5861 213.3668 247.5496 291.2552
#> [19,] 181.6730 170.3478 160.4956 158.9230 158.3417 172.3015 203.9928 256.2007
#> [20,] 149.6597 134.3975 121.0516 120.4458 120.0029 133.5485 163.1451 222.5073
#> [21,] 148.3682 133.9047 120.3889 120.1032 119.0489 131.4054 158.9553 210.6348
#> [22,] 157.5122 144.2774 133.5701 134.1695 132.8444 142.1546 163.3423 199.3750
#> [23,] 186.7835 177.5326 169.0679 169.3129 167.0564 173.9476 190.4623 207.4274
#> [24,] 196.4137 189.4402 182.8918 184.0646 181.7316 186.7886 200.0759 207.5360
#>           [,9]    [,10]    [,11]    [,12]    [,13]    [,14]    [,15]    [,16]
#>  [1,] 226.3456 219.8945 228.1157 234.2608 231.2138 233.9530 230.1144 226.0504
#>  [2,] 228.4487 219.7326 226.8837 233.5810 229.5075 233.1102 229.1858 226.0130
#>  [3,] 222.1118 212.3350 219.6527 227.0882 223.0144 227.7527 223.5811 220.9978
#>  [4,] 223.8089 213.4931 219.8745 227.3861 222.9140 228.1423 223.9115 221.6211
#>  [5,] 223.8012 212.9526 218.6856 226.3003 221.9454 227.1469 223.2323 221.4165
#>  [6,] 237.6298 226.6528 230.6395 237.4389 233.6443 238.0900 233.9177 233.0184
#>  [7,] 278.0906 266.3497 266.6847 271.1360 267.3881 269.8659 264.0867 264.5560
#>  [8,] 322.7289 314.3064 307.0494 307.0040 305.0501 303.5704 296.4667 297.1976
#>  [9,] 343.0693 336.7780 326.7601 324.6390 323.2094 320.1780 311.7412 312.6031
#> [10,] 336.7780 340.3684 329.1381 325.1875 324.1657 318.5914 309.0846 307.8505
#> [11,] 326.7601 329.1381 326.9181 326.0395 324.6212 320.9409 311.8707 309.8280
#> [12,] 324.6390 325.1875 326.0395 329.9153 328.6835 327.1141 319.2309 316.8981
#> [13,] 323.2094 324.1657 324.6212 328.6835 330.6353 328.7910 321.1894 318.6517
#> [14,] 320.1780 318.5914 320.9409 327.1141 328.7910 332.0312 325.5098 323.4069
#> [15,] 311.7412 309.0846 311.8707 319.2309 321.1894 325.5098 323.6950 322.0187
#> [16,] 312.6031 307.8505 309.8280 316.8981 318.6517 323.4069 322.0187 325.9600
#> [17,] 316.3954 310.5348 311.9408 319.0583 321.2199 326.5196 325.5697 331.4524
#> [18,] 308.8416 305.3038 306.3017 311.6091 314.4784 318.6163 317.3094 322.2924
#> [19,] 273.1979 274.9097 276.7746 280.0408 284.0840 285.1320 283.9295 287.4406
#> [20,] 239.7452 245.6962 242.6409 243.5415 248.7815 247.2886 245.7705 246.9752
#> [21,] 226.0114 231.1596 230.7863 233.5436 238.8988 238.0828 235.4889 235.7055
#> [22,] 211.2727 212.5124 217.5108 223.1106 228.4882 230.0760 227.4755 227.3078
#> [23,] 215.6305 213.1279 222.9295 231.9338 236.2411 240.6431 239.5879 238.3798
#> [24,] 213.3396 208.0330 219.7623 230.1668 231.9213 239.4201 239.7397 239.4532
#>          [,17]    [,18]    [,19]    [,20]    [,21]    [,22]    [,23]    [,24]
#>  [1,] 222.8072 209.8491 181.6730 149.6597 148.3682 157.5122 186.7835 196.4137
#>  [2,] 222.4622 206.6692 170.3478 134.3975 133.9047 144.2774 177.5326 189.4402
#>  [3,] 217.3451 199.7570 160.4956 121.0516 120.3889 133.5701 169.0679 182.8918
#>  [4,] 218.1453 199.8573 158.9230 120.4458 120.1032 134.1695 169.3129 184.0646
#>  [5,] 218.0121 199.5861 158.3417 120.0029 119.0489 132.8444 167.0564 181.7316
#>  [6,] 230.8193 213.3668 172.3015 133.5485 131.4054 142.1546 173.9476 186.7886
#>  [7,] 264.1622 247.5496 203.9928 163.1451 158.9553 163.3423 190.4623 200.0759
#>  [8,] 300.0173 291.2552 256.2007 222.5073 210.6348 199.3750 207.4274 207.5360
#>  [9,] 316.3954 308.8416 273.1979 239.7452 226.0114 211.2727 215.6305 213.3396
#> [10,] 310.5348 305.3038 274.9097 245.6962 231.1596 212.5124 213.1279 208.0330
#> [11,] 311.9408 306.3017 276.7746 242.6409 230.7863 217.5108 222.9295 219.7623
#> [12,] 319.0583 311.6091 280.0408 243.5415 233.5436 223.1106 231.9338 230.1668
#> [13,] 321.2199 314.4784 284.0840 248.7815 238.8988 228.4882 236.2411 231.9213
#> [14,] 326.5196 318.6163 285.1320 247.2886 238.0828 230.0760 240.6431 239.4201
#> [15,] 325.5697 317.3094 283.9295 245.7705 235.4889 227.4755 239.5879 239.7397
#> [16,] 331.4524 322.2924 287.4406 246.9752 235.7055 227.3078 238.3798 239.4532
#> [17,] 341.6639 334.3879 300.8888 259.9330 247.3509 236.6134 245.3503 245.8630
#> [18,] 334.3879 334.9841 310.7268 274.6303 259.9502 244.4607 246.0162 241.9221
#> [19,] 300.8888 310.7268 313.5153 290.8029 275.2674 251.7602 238.1319 226.7409
#> [20,] 259.9330 274.6303 290.8029 305.5165 290.6680 254.5242 221.9332 203.9157
#> [21,] 247.3509 259.9502 275.2674 290.6680 297.3455 265.9319 230.0656 209.6839
#> [22,] 236.6134 244.4607 251.7602 254.5242 265.9319 258.4218 233.6798 215.4848
#> [23,] 245.3503 246.0162 238.1319 221.9332 230.0656 233.6798 244.9685 234.7553
#> [24,] 245.8630 241.9221 226.7409 203.9157 209.6839 215.4848 234.7553 243.5936