deviance: Residual sum of squares

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Extracting the residual sum of squares

Usage

1
  deviance(.Object)

Arguments

.Object

An S4 object created by ycinter or ycextra.

Details

This function extracts the residual sum of squares after the intepolation or extrapolation. When extrapolation is carried out, the function uses the values observed in the liquid part of the curve

Value

A numeric giving the residual sum of squares

Author(s)

Thierry Moudiki

See Also

ycsummary

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Prices
 p <- c(0.9859794,0.9744879,0.9602458,0.9416551,0.9196671,0.8957363,0.8716268,0.8482628,
 0.8255457,0.8034710,0.7819525,0.7612204,0.7416912,0.7237042,0.7072136
 ,0.6922140,0.6785227,0.6660095,0.6546902,0.6441639,0.6343366,0.6250234,0.6162910,0.6080358,
 0.6003302,0.5929791,0.5858711,0.5789852,0.5722068,0.5653231)

 # Observed maturities
 u <- 1:30

 # Output maturities
 t <- seq(from = 1, to = 30, by = 0.5)

 # Svensson interpolation
 yc <- ycinter(p = p, matsin = u, matsout = t,
 method="SW", typeres="prices")

 deviance(yc)

Example output

Loading required package: compiler

Attaching package: 'ycinterextra'

The following objects are masked from 'package:stats':

    deviance, fitted, residuals

The following object is masked from 'package:base':

    as.list

[1] 1.402423e-22

ycinterextra documentation built on May 1, 2019, 8:02 p.m.