Skip to content

Commit b9bb5ed

Browse files
author
OVVO-Financial
committed
NNS 11.1 Beta
1 parent 7283e22 commit b9bb5ed

13 files changed

+104
-40
lines changed

NNS_11.1.tar.gz

4.14 KB
Binary file not shown.

NNS_11.1.zip

-15 Bytes
Binary file not shown.

R/SD_Cluster.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#'
66
#' @param data A numeric matrix or data frame of variables to be clustered.
77
#' @param degree Numeric options: (1, 2, 3). Degree of stochastic dominance test.
8-
#' @param type Character, either \code{"continuous"} (default) or \code{"discrete"}; specifies the type of CDF.
8+
#' @param type Character, either \code{"discrete"} (default) or \code{"continuous"}; specifies the type of CDF.
99
#' @param min_cluster Integer. The minimum number of elements required for a valid cluster.
1010
#' @param dendrogram Logical; \code{FALSE} (default). If \code{TRUE}, a dendrogram is produced based on a simple "distance" measure between clusters.
1111
#'
@@ -48,7 +48,7 @@
4848
#' @export
4949

5050

51-
NNS.SD.cluster <- function(data, degree = 1, type = "continuous", min_cluster = 1, dendrogram = FALSE) {
51+
NNS.SD.cluster <- function(data, degree = 1, type = "discrete", min_cluster = 1, dendrogram = FALSE) {
5252
clusters <- list()
5353
iteration <- 1
5454

doc/NNSvignette_Comparing_Distributions.R

+15-13
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,21 @@ NNS.ANOVA(control = x, treatment = y,
4848
## ----stochdom, fig.width=7, fig.align='center'--------------------------------
4949
NNS.FSD(x, y)
5050

51-
## ----stochdomset, eval=FALSE--------------------------------------------------
52-
# set.seed(123)
53-
# x1 = rnorm(1000)
54-
# x2 = x1 + 1
55-
# x3 = rnorm(1000)
56-
# x4 = x3 + 1
57-
# x5 = rnorm(1000)
58-
# x6 = x5 + 1
59-
# x7 = rnorm(1000)
60-
# x8 = x7 + 1
61-
#
62-
# NNS.SD.efficient.set(cbind(x1, x2, x3, x4, x5, x6, x7, x8), degree = 1, status = FALSE)
63-
# [1] "x4" "x2" "x8" "x6"
51+
## ----stochdomset, eval=TRUE---------------------------------------------------
52+
set.seed(123)
53+
x1 = rnorm(1000)
54+
x2 = x1 + 1
55+
x3 = rnorm(1000)
56+
x4 = x3 + 1
57+
x5 = rnorm(1000)
58+
x6 = x5 + 1
59+
x7 = rnorm(1000)
60+
x8 = x7 + 1
61+
62+
NNS.SD.efficient.set(cbind(x1, x2, x3, x4, x5, x6, x7, x8), degree = 1, status = FALSE)
63+
64+
## ----stochdomclust, eval=TRUE, fig.width=7, fig.align='center'----------------
65+
NNS.SD.cluster(cbind(x1, x2, x3, x4, x5, x6, x7, x8), degree = 1, dendrogram = TRUE)
6466

6567
## ----threads, echo = FALSE----------------------------------------------------
6668
Sys.setenv("OMP_THREAD_LIMIT" = "")

doc/NNSvignette_Comparing_Distributions.Rmd

+10-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ NNS.FSD(x, y)
113113

114114
`x2, x4, x6, x8` all dominate their preceding distributions yet do not dominate one another, and are thus included in the first degree stochastic dominance efficient set.
115115

116-
```{r stochdomset, eval=FALSE}
116+
```{r stochdomset, eval=TRUE}
117117
set.seed(123)
118118
x1 = rnorm(1000)
119119
x2 = x1 + 1
@@ -125,7 +125,15 @@ x7 = rnorm(1000)
125125
x8 = x7 + 1
126126
127127
NNS.SD.efficient.set(cbind(x1, x2, x3, x4, x5, x6, x7, x8), degree = 1, status = FALSE)
128-
[1] "x4" "x2" "x8" "x6"
128+
```
129+
130+
131+
## Stochastic Dominant Clusters
132+
133+
Further, we can assign clusters to non dominated constituents and represent the clustering in a dendrogram.
134+
135+
```{r stochdomclust, eval=TRUE, fig.width=7, fig.align='center'}
136+
NNS.SD.cluster(cbind(x1, x2, x3, x4, x5, x6, x7, x8), degree = 1, dendrogram = TRUE)
129137
```
130138

131139
# References {#references}

doc/NNSvignette_Comparing_Distributions.html

+24-2
Original file line numberDiff line numberDiff line change
@@ -616,8 +616,30 @@ <h2>Stochastic Dominant Efficient Sets</h2>
616616
<span id="cb18-8"><a href="#cb18-8" tabindex="-1"></a>x7 <span class="ot">=</span> <span class="fu">rnorm</span>(<span class="dv">1000</span>)</span>
617617
<span id="cb18-9"><a href="#cb18-9" tabindex="-1"></a>x8 <span class="ot">=</span> x7 <span class="sc">+</span> <span class="dv">1</span></span>
618618
<span id="cb18-10"><a href="#cb18-10" tabindex="-1"></a></span>
619-
<span id="cb18-11"><a href="#cb18-11" tabindex="-1"></a><span class="fu">NNS.SD.efficient.set</span>(<span class="fu">cbind</span>(x1, x2, x3, x4, x5, x6, x7, x8), <span class="at">degree =</span> <span class="dv">1</span>, <span class="at">status =</span> <span class="cn">FALSE</span>)</span>
620-
<span id="cb18-12"><a href="#cb18-12" tabindex="-1"></a>[<span class="dv">1</span>] <span class="st">&quot;x4&quot;</span> <span class="st">&quot;x2&quot;</span> <span class="st">&quot;x8&quot;</span> <span class="st">&quot;x6&quot;</span></span></code></pre></div>
619+
<span id="cb18-11"><a href="#cb18-11" tabindex="-1"></a><span class="fu">NNS.SD.efficient.set</span>(<span class="fu">cbind</span>(x1, x2, x3, x4, x5, x6, x7, x8), <span class="at">degree =</span> <span class="dv">1</span>, <span class="at">status =</span> <span class="cn">FALSE</span>)</span></code></pre></div>
620+
<pre><code>## [1] &quot;x4&quot; &quot;x2&quot; &quot;x8&quot; &quot;x6&quot;</code></pre>
621+
</div>
622+
<div id="stochastic-dominant-clusters" class="section level2">
623+
<h2>Stochastic Dominant Clusters</h2>
624+
<p>Further, we can assign clusters to non dominated constituents and
625+
represent the clustering in a dendrogram.</p>
626+
<div class="sourceCode" id="cb20"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb20-1"><a href="#cb20-1" tabindex="-1"></a><span class="fu">NNS.SD.cluster</span>(<span class="fu">cbind</span>(x1, x2, x3, x4, x5, x6, x7, x8), <span class="at">degree =</span> <span class="dv">1</span>, <span class="at">dendrogram =</span> <span class="cn">TRUE</span>)</span></code></pre></div>
627+
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqAAAAEgCAMAAABc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UABayBQwBoIFLAGAgWsgUABayBQwBoIFLAGAgWsgUABayBQwBoIFLAGAgWsgUABayBQwBoIFLAGAgWsgUABayBQwBoIFLAGAgWsgUABayDQRHZ3V/f1h2l8ZLu4DX9sZrcdqeAgEGgq6+I2+n83EOiJQKCpbBe25lzdPPR8CwI9EQg0mZVp47eLuf5cFLoi3b76obj6r5FinbKZ/WlWFPNaoGVhPqtUexTsBQJNxlaO68lSqVFVpqX6sF2o6tRI0aVsZuafuUkt68/mzP6uwZMHAk3Gjo50C799tbR6NdWplqJP0XpUUr26V6m2sl1f3a/r8RXYDwSajpJd6GOudZttKk/X2zQpvppVqaay1SnbBRR6CAg0HdNqG6mpvuXVv2dUoC5l88yI8pkRaGG5VZUv+qAHgEAzsLr51TTzpprcUIH6lHYN6k+O/gININAMrCc/mgrS9CnXtIn3KXUf9ObB9EFppYl5p14g0Azs7n5nJkFt5VnM4xrUpJhRvNNuaUb8k6WpSteoQfuAQHNQmllN0+OcLFemHQ99UJNi50FJamHrVn145MLzBgIFrIFAAWsgUMAaCBSwBgIFrIFAAWsgUMAaCBSwBgIFrIFAAWsgUMAaCBSwBgIFrIFAAWsgUMAaCBSwBgIFrIFAAWsgUMAaCBSwBgIFrIFAAWsgUMAaCBSw5v+1rzslO1N3rgAAAABJRU5ErkJggg==" style="display: block; margin: auto;" /></p>
628+
<pre><code>## $Clusters
629+
## $Clusters$Cluster_1
630+
## [1] &quot;x4&quot; &quot;x2&quot; &quot;x8&quot; &quot;x6&quot;
631+
##
632+
## $Clusters$Cluster_2
633+
## [1] &quot;x3&quot; &quot;x1&quot; &quot;x7&quot; &quot;x5&quot;
634+
##
635+
##
636+
## $Dendrogram
637+
##
638+
## Call:
639+
## hclust(d = dist_matrix, method = &quot;complete&quot;)
640+
##
641+
## Cluster method : complete
642+
## Number of objects: 8</code></pre>
621643
</div>
622644
</div>
623645
<div id="references" class="section level1">

doc/NNSvignette_Forecasting.Rmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ NNS also offers a wrapper function **`NNS.ARMA.optim()`** to test a given vector
119119
Given our monthly dataset, we will try multiple years by setting `seasonal.factor = seq(12, 60, 6)` every 6 months based on our **NNS.seas()** insights above.
120120

121121
```{r best optim, eval=FALSE}
122-
nns.optimal = NNS.ARMA.optim(AirPassengers,
122+
nns.optimal = NNS.ARMA.optim(AirPassengers,
123123
training.set = 100,
124124
seasonal.factor = seq(12, 60, 6),
125125
obj.fn = expression( sqrt(mean((predicted - actual)^2)) ),

doc/NNSvignette_Forecasting.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ <h2>Cross-Validating All Combinations of
501501
<p>Given our monthly dataset, we will try multiple years by setting
502502
<code>seasonal.factor = seq(12, 60, 6)</code> every 6 months based on
503503
our <strong>NNS.seas()</strong> insights above.</p>
504-
<div class="sourceCode" id="cb15"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb15-1"><a href="#cb15-1" tabindex="-1"></a>nns.optimal <span class="ot">=</span> <span class="fu">NNS.ARMA.optim</span>(AirPassengers, </span>
504+
<div class="sourceCode" id="cb15"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb15-1"><a href="#cb15-1" tabindex="-1"></a>nns.optimal <span class="ot">=</span> <span class="fu">NNS.ARMA.optim</span>(AirPassengers,</span>
505505
<span id="cb15-2"><a href="#cb15-2" tabindex="-1"></a> <span class="at">training.set =</span> <span class="dv">100</span>, </span>
506506
<span id="cb15-3"><a href="#cb15-3" tabindex="-1"></a> <span class="at">seasonal.factor =</span> <span class="fu">seq</span>(<span class="dv">12</span>, <span class="dv">60</span>, <span class="dv">6</span>),</span>
507507
<span id="cb15-4"><a href="#cb15-4" tabindex="-1"></a> <span class="at">obj.fn =</span> <span class="fu">expression</span>( <span class="fu">sqrt</span>(<span class="fu">mean</span>((predicted <span class="sc">-</span> actual)<span class="sc">^</span><span class="dv">2</span>)) ),</span>

man/NNS.SD.cluster.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/NNS.dll

0 Bytes
Binary file not shown.

vignettes/NNSvignette_Comparing_Distributions.R

+15-13
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,21 @@ NNS.ANOVA(control = x, treatment = y,
4848
## ----stochdom, fig.width=7, fig.align='center'--------------------------------
4949
NNS.FSD(x, y)
5050

51-
## ----stochdomset, eval=FALSE--------------------------------------------------
52-
# set.seed(123)
53-
# x1 = rnorm(1000)
54-
# x2 = x1 + 1
55-
# x3 = rnorm(1000)
56-
# x4 = x3 + 1
57-
# x5 = rnorm(1000)
58-
# x6 = x5 + 1
59-
# x7 = rnorm(1000)
60-
# x8 = x7 + 1
61-
#
62-
# NNS.SD.efficient.set(cbind(x1, x2, x3, x4, x5, x6, x7, x8), degree = 1, status = FALSE)
63-
# [1] "x4" "x2" "x8" "x6"
51+
## ----stochdomset, eval=TRUE---------------------------------------------------
52+
set.seed(123)
53+
x1 = rnorm(1000)
54+
x2 = x1 + 1
55+
x3 = rnorm(1000)
56+
x4 = x3 + 1
57+
x5 = rnorm(1000)
58+
x6 = x5 + 1
59+
x7 = rnorm(1000)
60+
x8 = x7 + 1
61+
62+
NNS.SD.efficient.set(cbind(x1, x2, x3, x4, x5, x6, x7, x8), degree = 1, status = FALSE)
63+
64+
## ----stochdomclust, eval=TRUE, fig.width=7, fig.align='center'----------------
65+
NNS.SD.cluster(cbind(x1, x2, x3, x4, x5, x6, x7, x8), degree = 1, dendrogram = TRUE)
6466

6567
## ----threads, echo = FALSE----------------------------------------------------
6668
Sys.setenv("OMP_THREAD_LIMIT" = "")

vignettes/NNSvignette_Comparing_Distributions.Rmd

+10-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ NNS.FSD(x, y)
113113

114114
`x2, x4, x6, x8` all dominate their preceding distributions yet do not dominate one another, and are thus included in the first degree stochastic dominance efficient set.
115115

116-
```{r stochdomset, eval=FALSE}
116+
```{r stochdomset, eval=TRUE}
117117
set.seed(123)
118118
x1 = rnorm(1000)
119119
x2 = x1 + 1
@@ -125,7 +125,15 @@ x7 = rnorm(1000)
125125
x8 = x7 + 1
126126
127127
NNS.SD.efficient.set(cbind(x1, x2, x3, x4, x5, x6, x7, x8), degree = 1, status = FALSE)
128-
[1] "x4" "x2" "x8" "x6"
128+
```
129+
130+
131+
## Stochastic Dominant Clusters
132+
133+
Further, we can assign clusters to non dominated constituents and represent the clustering in a dendrogram.
134+
135+
```{r stochdomclust, eval=TRUE, fig.width=7, fig.align='center'}
136+
NNS.SD.cluster(cbind(x1, x2, x3, x4, x5, x6, x7, x8), degree = 1, dendrogram = TRUE)
129137
```
130138

131139
# References {#references}

0 commit comments

Comments
 (0)