Description Usage Arguments Details Value References See Also Examples
Fit probability distributions, via continuous kernel smoothing, from data.
NOTE THAT THESE OBJECTS ARE LIKELY TO BE CONVERTED TO S4 OBJECTS, IN THE NEAR FUTURE.
ALSO, NOTE THAT THEIR INTERNAL STRUCTURE (THAT IS, THEIR ATTRIBUTES/SLOTS), IS SUBJECT TO CHANGE.
IN PRINCIPLE, YOU SHOULD NOT ACCESS ATTRIBUTES/SLOTS, DIRECTLY.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | #univariate
pdfuv.cks (x, ..., w,
bw, smoothness=1,
kernel=BIWEIGHT.CKERNEL,
spline=TRUE, bw.method="ph.default", nc=30,
trtype="local",
Xlim = cbind (a, b), a=-Inf, b=Inf)
cdfuv.cks (x, ..., w,
bw, smoothness=1,
kernel=BIWEIGHT.CKERNEL,
spline=TRUE, bw.method="ph.default", nc=30, tail="lower",
trtype="local",
Xlim = cbind (a, b), a=-Inf, b=Inf)
qfuv.cks (x, ..., w,
bw, smoothness=1,
kernel=BIWEIGHT.CKERNEL,
bw.method="ph.default", nc=30,
trtype="local",
Xlim = cbind (a, b), a=-Inf, b=Inf)
#multivariate
pdfmv.cks (x, ..., w,
bw, smoothness=1,
kernel=BIWEIGHT.CKERNEL,
bw.method="ph.default",
Xlim = cbind (a, b), a=-Inf, b=Inf)
cdfmv.cks (x, ..., w,
bw, smoothness=1,
kernel=BIWEIGHT.CKERNEL,
bw.method="ph.default", tail="lower",
Xlim = cbind (a, b), a=-Inf, b=Inf)
#conditional
pdfc.cks (x, ..., conditions, w,
bw, smoothness=1,
kernel=BIWEIGHT.CKERNEL,
spline=TRUE, bw.method="ph.default", nc=30,
Xlim = cbind (a, b), a=-Inf, b=Inf,
preserve.range=FALSE, as.cset=FALSE, as.list.cset=FALSE,
warning=TRUE)
cdfc.cks (x, ..., conditions, w,
bw, smoothness=1,
kernel=BIWEIGHT.CKERNEL,
spline=TRUE, bw.method="ph.default", nc=30, tail="lower",
Xlim = cbind (a, b), a=-Inf, b=Inf,
preserve.range=FALSE, as.cset=FALSE, as.list.cset=FALSE,
warning=TRUE)
qfc.cks (x, ..., conditions, w,
bw, smoothness=1,
kernel=BIWEIGHT.CKERNEL,
bw.method="ph.default", nc=30,
Xlim = cbind (a, b), a=-Inf, b=Inf,
preserve.range=FALSE, as.cset=FALSE, as.list.cset=FALSE,
warning=TRUE)
pdfmvc.cks (x, ..., conditions, w,
bw, smoothness=1,
kernel=BIWEIGHT.CKERNEL,
bw.method="ph.default",
Xlim = cbind (a, b), a=-Inf, b=Inf,
preserve.range=FALSE, as.cset=FALSE, as.list.cset=FALSE,
warning=TRUE)
#multivariate-conditional
cdfmvc.cks (x, ..., conditions, w,
bw, smoothness=1,
kernel=BIWEIGHT.CKERNEL,
bw.method="ph.default", tail="lower",
Xlim = cbind (a, b), a=-Inf, b=Inf,
preserve.range=FALSE, as.cset=FALSE, as.list.cset=FALSE,
warning=TRUE)
#other
chqf.cks (x, ..., w,
bw, smoothness=1,
kernel=BIWEIGHT.CKERNEL,
bw.method="ph.default", nc=16)
|
x |
IN UNIVARIATE CONSTRUCTORS: IN OTHER CONSTRUCTORS: |
conditions |
SIMPLE USE: Note that in univariate-conditional distributions, the number of conditioning variables needs to equal the total number of variables minus one. |
w |
Optional numeric vector of weights. |
bw |
Postive numeric vector of length [1 or m], the bandwidth parameter(s). |
smoothness |
Positive numeric vector of length [1 or m], the relative smoothness parameter(s). |
kernel |
A (continuous) kernel object. |
spline |
Logical, if true, use cubic Hermite splines as intermediate models. |
bw.method |
String, the bandwidth selection method. |
nc |
Integer, number of control points, in the spline. |
tail |
Character vector of length [1 or M], either "lower" or "upper". |
trtype |
String, either "simple", "local" or "reflect", refer to vignette. |
Xlim |
An ([1 or m] by 2) numeric matrix, giving the limits of each X variable. |
a, b |
Numeric vectors of length [1 or m]. |
preserve.range |
Logical vector of length [1 or M]. |
as.cset |
Logical, if true, a cset object is returned regardless of the number of conditions. |
as.list.cset |
Logical, refer to as.cset, above. |
warning |
Logical, if true, generate warning if there's no observations within the conditional window. |
... |
Additional arguments not allowed |
PLEASE SET NOTES IN DESCRIPTION FIELD.
Here, M refers to the number of random variables (in the model), and m refers to the total number of variables.
In nonconditional models, these are the same.
In univariate-conditional models, M is one and m is equals to the number of conditions plus one.
Variable names use default values, if the x matrix is unnamed.
(In conditional models, a warning is generated).
In conditional models, variables are reordered (internally), if there's named conditions.
Note you can check names (and their order), with names method.
(By default, only the conditional variables are returned).
Parameters that need to match m (the total number of variables), such as bw, smoothness and Xlim, will match the original data, regardless of the order of the conditions.
i.e. The first bw value will match the first column in x, regardless of the order of the conditions.
However, parameters that need to match M (the number of random variables), such as tail, need to match the order of the resulting conditional variables.
The same principle, applies to the x argument in the resulting function objects.
Refer to the vignette for more information.
Self-referencing function objects.
Refer to Runtime Function Objects
Except:
The constructors for conditional distributions, return NULL, if there's no observations within the conditional window.
(And by default, generate a warning).
They may also return cset objects, if as.cset is true, or there's more than one set of conditions.
Refer to the vignette for an overview, references and better examples.
Kernels
Succinct Constructors
Discrete Kernel Smoothing, Categorical Distributions, Empirical-Like Distributions
Conditional Distributions with Mixed Input Types
These can be used for statistical classification purposes.
is.cks, ph.printf.phmodel, ph.plotf.cksuv, ph.plotf.cksmv
Bandwidth Selection
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | prep.ph.data ()
###########
#univariate
###########
uvfh <- pdfuv.cks (height)
uvFh <- cdfuv.cks (height)
uvFht <- qfuv.cks (height)
plot (uvfh)
plot (uvFh)
plot (uvfh, TRUE)
uvFht (c (0.25, 0.5, 0.75) )
ph.mode (uvfh)
ph.mode (uvfh, TRUE)
#############
#multivariate
#############
mvfh <- pdfmv.cks (trees2 [,-2])
mvFh <- cdfmv.cks (trees2 [,-2])
plot (mvfh, TRUE)
plot (mvfh,, TRUE)
plot (mvFh, TRUE)
plot (mvFh, fb = c (0.2, 0.8), clabs = c ("A", "B") )
##############
#conditional
#(single model)
###############
cons.c1 <- c (height=25, girth=35)
cfh <- pdfc.cks (trees2, conditions=cons.c1)
cFh <- cdfc.cks (trees2, conditions=cons.c1)
cFht <- qfc.cks (trees2, conditions=cons.c1)
plot (cfh)
plot (cFh)
plot (cfh, TRUE)
cFht (c (0.25, 0.5, 0.75) )
ph.mode (cfh)
ph.mode (cfh, TRUE)
#############
#conditional
#(two models)
#############
cons.c2 <- cbind (height=25:26, girth=35:36)
cfhs <- pdfc.cks (trees2, conditions=cons.c2, as.list.cset=TRUE)
plot (cfhs [[1]])
#########################
#multivariate-conditional
#########################
cons.mvc <- c (depth=311)
mvcFh <- cdfmvc.cks (quakes2, conditions=cons.mvc)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.