Title: | Distribution Classes for Distributions from Rmetrics |
---|---|
Description: | S4-distribution classes based on package distr for distributions from packages 'fBasics' and 'fGarch'. |
Authors: | Peter Ruckdeschel [cre, cph, aut] |
Maintainer: | Peter Ruckdeschel <[email protected]> |
License: | LGPL-3 |
Version: | 2.8.2 |
Built: | 2024-11-06 02:16:29 UTC |
Source: | https://github.com/r-forge/distr |
distrRmetrics provides infrastructure / (S4-)classes (based on package distr) for distributions contributed in the Rmetrics packages.
Package: | distrRmetrics |
Version: | 2.8.2 |
Date: | 2024-01-30 |
Depends: | R(>= 3.4), methods, distr(>= 2.4), fBasics(>= 270.73), fGarch(>= 270.73) |
Suggests: | distrEx(>= 2.4), distrMod(>= 2.4) |
Imports: startupmsg | |
ByteCompile: | yes |
License: | LGPL-3 |
URL: | https://distr.r-forge.r-project.org/ |
VCS/SVNRevision: | 1427 |
################################### Distribution Classes ################################### [*]: there is a generating function with the same name "Distribution" (from distr) |>"AbscontDistribution" (from distr) |>|>"SNorm" [*] |>|>"SSTd" [*]
STd Functions to generate an "AbscontDistribution" object implementing a standardized T distribution
All slots are inspected / modified by corresponding accessors / -replacement functions.
You may suppress the start-up banner/message completely by setting options("StartupBanner"="off")
somewhere before loading this package by library
or require
in your R-code / R-session.
If option "StartupBanner"
is not defined (default) or setting
options("StartupBanner"=NULL)
or options("StartupBanner"="complete")
the complete start-up banner is displayed.
For any other value of option "StartupBanner"
(i.e., not in c(NULL,"off","complete")
)
only the version information is displayed.
The same can be achieved by wrapping the library
or require
call into
either suppressStartupMessages()
or
onlytypeStartupMessages(.,atypes="version")
.
As for general packageStartupMessage
's, you may also suppress all
the start-up banner by wrapping the library
or require
call into suppressPackageStartupMessages()
from
startupmsg-version 0.5 on.
Note: The first two numbers of package versions do not necessarily reflect package-individual development, but rather are chosen for the distrXXX family as a whole in order to ease updating "depends" information.
Peter Ruckdeschel [email protected],
Maintainer: Peter Ruckdeschel [email protected]
P. Ruckdeschel, M. Kohl, T. Stabla, F. Camphausen (2006):
S4 Classes for Distributions, R News, 6(2), 2-6.
https://CRAN.R-project.org/doc/Rnews/Rnews_2006-2.pdf
A vignette for packages distr, distrSim, distrTEst, distrEx,
distrTeach, distrMod, and distrRmetrics
is included into the mere documentation package distrDoc and may be called by
require("distrDoc");vignette("distr")
.
A homepage to this package is available under
https://distr.r-forge.r-project.org/.
Generates an object of class "SNorm"
.
SNorm(mean = 0, sd = 1, xi = 1.5)
SNorm(mean = 0, sd = 1, xi = 1.5)
mean |
real number: location parameter of the SNorm distribution. |
sd |
positive real number: scale parameter of the SNorm distribution |
xi |
positive real number: shape parameter of the SSTd distribution. |
Object of class "SNorm"
This class is based on the code provided by the package fGarch by Diethelm Wuertz
Peter Ruckdeschel [email protected]
dsnorm
, AbscontDistribution-class
(SN <- SNorm(mean = 1, sd = 1, xi = 0.5)) plot(SN)
(SN <- SNorm(mean = 1, sd = 1, xi = 0.5)) plot(SN)
The skew normal distribution.
Objects can be created by calls of the form new("SNorm", mean, sd,xi)
.
More frequently they are created via the generating function
SNorm
.
img
Object of class "Reals"
.
param
Object of class "SNormParameter"
.
r
rgpd
d
dgpd
p
pgpd
, but vectorized and with special treatment of
arguments lower.tail
and log.p
q
qgpd
, but vectorized and with special treatment of
arguments lower.tail
and log.p
gaps
(numeric) matrix or NULL
.withArith
logical: used internally to issue warnings as to interpretation of arithmetics
.withSim
logical: used internally to issue warnings as to accuracy
.logExact
logical: used internally to flag the case where there are explicit formulae for the log version of density, cdf, and quantile function
.lowerExact
logical: used internally to flag the case where there are explicit formulae for the lower tail version of cdf and quantile function
Class "AbscontDistribution"
, directly.
Class "UnivariateDistribution"
, by class "AbscontDistribution"
.
Class "Distribution"
, by class "AbscontDistribution"
.
signature(object = "SNorm")
: wrapped access method for
slot xi
of slot param
.
signature(object = "SNorm")
: wrapped access method for
slot mean
of slot param
.
signature(object = "SNorm")
: wrapped access method for
slot nu
of slot param
.
signature(x = "SNorm")
: wrapped access method for
slot sd
of slot param
.
signature(object = "SNorm")
: wrapped replace method for
slot xi
of slot param
.
signature(object = "SNorm")
: wrapped replace method for
slot mean
of slot param
.
signature(object = "SNorm")
: wrapped replace method for
slot nu
of slot param
.
signature(x = "SNorm")
: wrapped replace method for
slot sd
of slot param
.
This class is based on the code provided by the package fGarch by Diethelm Wuertz
Peter Ruckdeschel [email protected]
dsnorm
, AbscontDistribution-class
(SN <- SNorm(xi=2)) # SN is a skewed normal distribution with nu = 3. set.seed(1) r(SN)(1) # one random number generated from this distribution, e.g. -0.4037723 d(SN)(1) # Density of this distribution is 0.1914826 for x = 1. p(SN)(1) # Probability that x < 1 is 0.8374454. q(SN)(.1) # Probability that x < -1.137878 is 0.1. ## in RStudio or Jupyter IRKernel, use q.l(.)(.) instead of q(.)(.) xi(SN) # shape of this distribution is 2. xi(SN) <- 2.5 # shape of this distribution is now 2.5. plot(SN)
(SN <- SNorm(xi=2)) # SN is a skewed normal distribution with nu = 3. set.seed(1) r(SN)(1) # one random number generated from this distribution, e.g. -0.4037723 d(SN)(1) # Density of this distribution is 0.1914826 for x = 1. p(SN)(1) # Probability that x < 1 is 0.8374454. q(SN)(.1) # Probability that x < -1.137878 is 0.1. ## in RStudio or Jupyter IRKernel, use q.l(.)(.) instead of q(.)(.) xi(SN) # shape of this distribution is 2. xi(SN) <- 2.5 # shape of this distribution is now 2.5. plot(SN)
The class of the parameter of an SNorm distribution.
Objects can be created by calls of the form new("SNormParameter", ...)
.
mean
real number: location parameter of a SNorm distribution.
sd
real number: scale parameter of a SNorm distribution.
name
default name is “parameter of a SNorm distribution”.
xi
real number: shape parameter of a SNorm distribution.
Class "Parameter"
, directly.
Class "OptionalParameter"
, by class "Parameter"
.
signature(object = "SNormParameter")
: access method for
slot mean
.
signature(object = "SNormParameter")
: access method for
slot sd
.
signature(object = "SNormParameter")
: access method for
slot xi
.
Peter Ruckdeschel [email protected]
P <- new("SNormParameter") mean(P) sd(P) xi(P) P
P <- new("SNormParameter") mean(P) sd(P) xi(P) P
Generates an object of class "SSTd"
.
SSTd(mean = 0, sd = 1, nu = 5, xi = 1.5)
SSTd(mean = 0, sd = 1, nu = 5, xi = 1.5)
mean |
real number: location parameter of the SSTd distribution. |
sd |
positive real number: scale parameter of the SSTd distribution |
xi |
positive real number: shape parameter of the SSTd distribution. |
nu |
real number larger than 2: degree of freedom parameter of the SSTd distribution. |
Object of class "SSTd"
This class is based on the code provided by the package fGarch by Diethelm Wuertz
Peter Ruckdeschel [email protected]
dsstd
, AbscontDistribution-class
(ST <- SSTd(mean = 1, sd = 1, xi = 0.5)) plot(ST)
(ST <- SSTd(mean = 1, sd = 1, xi = 0.5)) plot(ST)
The standardized skew Student-t distribution.
Objects can be created by calls of the form new("SSTd", mean, sd,xi)
.
More frequently they are created via the generating function
SSTd
.
img
Object of class "Reals"
.
param
Object of class "SSTdParameter"
.
r
rgpd
d
dgpd
p
pgpd
, but vectorized and with special treatment of
arguments lower.tail
and log.p
q
qgpd
, but vectorized and with special treatment of
arguments lower.tail
and log.p
gaps
(numeric) matrix or NULL
.withArith
logical: used internally to issue warnings as to interpretation of arithmetics
.withSim
logical: used internally to issue warnings as to accuracy
.logExact
logical: used internally to flag the case where there are explicit formulae for the log version of density, cdf, and quantile function
.lowerExact
logical: used internally to flag the case where there are explicit formulae for the lower tail version of cdf and quantile function
Class "AbscontDistribution"
, directly.
Class "UnivariateDistribution"
, by class "AbscontDistribution"
.
Class "Distribution"
, by class "AbscontDistribution"
.
signature(object = "SSTd")
: wrapped access method for
slot xi
of slot param
.
signature(object = "SSTd")
: wrapped access method for
slot mean
of slot param
.
signature(object = "SSTd")
: wrapped access method for
slot nu
of slot param
.
signature(x = "SSTd")
: wrapped access method for
slot sd
of slot param
.
signature(object = "SSTd")
: wrapped replace method for
slot xi
of slot param
.
signature(object = "SSTd")
: wrapped replace method for
slot mean
of slot param
.
signature(object = "SSTd")
: wrapped replace method for
slot nu
of slot param
.
signature(x = "SSTd")
: wrapped replace method for
slot sd
of slot param
.
This class is based on the code provided by the package fGarch by Diethelm Wuertz
Peter Ruckdeschel [email protected]
dsstd
, AbscontDistribution-class
(ST <- SSTd(xi=2, nu = 3)) # ST is a skewed t distribution with xi = 2 and nu = 3. set.seed(1) r(ST)(1) # one random number generated from this distribution, e.g. -0.4432824 d(ST)(1) # Density of this distribution is 0.1204624 for x = 1. p(ST)(1) # Probability that x < 1 is 0.9035449. q(ST)(.1) # Probability that x < -0.4432824 is 0.1. ## in RStudio or Jupyter IRKernel, use q.l(.)(.) instead of q(.)(.) nu(ST) # df of this distribution is 3. nu(ST) <- 4 # df of this distribution is now 4. plot(ST)
(ST <- SSTd(xi=2, nu = 3)) # ST is a skewed t distribution with xi = 2 and nu = 3. set.seed(1) r(ST)(1) # one random number generated from this distribution, e.g. -0.4432824 d(ST)(1) # Density of this distribution is 0.1204624 for x = 1. p(ST)(1) # Probability that x < 1 is 0.9035449. q(ST)(.1) # Probability that x < -0.4432824 is 0.1. ## in RStudio or Jupyter IRKernel, use q.l(.)(.) instead of q(.)(.) nu(ST) # df of this distribution is 3. nu(ST) <- 4 # df of this distribution is now 4. plot(ST)
The class of the parameter of an SSTd distribution.
Objects can be created by calls of the form new("SSTdParameter", ...)
.
mean
real number: location parameter of a SSTd distribution.
sd
real number: scale parameter of a SSTd distribution.
xi
real number: shape parameter of a SSTd distribution.
nu
positive number: the degree of freedom parameter of a SSTd distribution.
name
default name is “parameter of a SSTd distribution”.
Class "Parameter"
, directly.
Class "OptionalParameter"
, by class "Parameter"
.
signature(object = "SSTdParameter")
: access method for
slot mean
.
signature(object = "SSTdParameter")
: access method for
slot sd
.
signature(object = "SSTdParameter")
: access method for
slot xi
.
signature(object = "SSTdParameter")
: access method for
slot nu
.
Peter Ruckdeschel [email protected]
P <- new("SSTdParameter") mean(P) sd(P) xi(P) nu(P) P
P <- new("SSTdParameter") mean(P) sd(P) xi(P) nu(P) P
Generates a scaled object of class "Td"
;
the scale (sd) is chosen such that STd(nu=3, sd=1)
has variance 1
independently from the degrees of freedom nu
. This object
is of class "AffLinAbscontDistribution"
.
STd(mean = 0, sd = 1, nu = 5)
STd(mean = 0, sd = 1, nu = 5)
mean |
real number: location parameter of the STd distribution. |
sd |
positive real number: scale parameter of the STd distribution |
nu |
real number larger than 2: degree of freedom parameter of the STd distribution. |
Object of class "STd"
This class is based on the code provided by the package fGarch by Diethelm Wuertz
Peter Ruckdeschel [email protected]
dstd
, AbscontDistribution-class
(ST <- STd(mean = 1, sd = 1, nu = 3)) plot(ST)
(ST <- STd(mean = 1, sd = 1, nu = 3)) plot(ST)