d1nat: Probability Mass Function Calculator

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

View source: R/stheoreme.R

Description

Function d1nat is applied to a pair of vectors or 1d arrays (sample outcomes, observation data values, time series data, 1d signal values, etc.) and generates the pair of corresponding probability mass functions (normalized vectors of counts).

Usage

1
d1nat(sample0, sample1, band=c(0,0), brks=0)

Arguments

sample0

vector of values (sample outcomes)

sample1

vector of values (sample outcomes)

band

two border values to set a range of considered sample values. The default c(0,0) sets full entire range i.e. range(sample0, sample1)

brks

value giving a number of bins (in a same manner as the number of cells for the histogram). The default brks=0 sets the number of bins chosen automatically as a square root of sample0 size.

Details

It works similarly to hist function but for pair of vectors with sample outcomes. As a bonus it prints basic statistics summary for distributions alongside with technical plot. It is recommended for use as a data preparation step before following Klimontovich's S-theorem based analysis.

Value

f0

probability vector representing state0 of a system

f1

probability vector representing state1 of a system

midpoints

vector of the centres of bins where probability values are calculated

Author(s)

Vitaly Efremov <vitaly.efremov@dcu.ie>

See Also

crit.stheorem, cxds.stheorem, d2nat.d1nat, d1char.d1nat

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#two modelling arrays: random with randomness distorted by power
s0<-runif(128,0,1)^2
s1<-runif(64,0,1)^2.3

b<-d1nat(sample0=s0,sample1=s1); b
b<-d1nat(s0,s1,brks=12,band=c(0.2,1)); b
   
#example of 3-step data analysis with Klimontovich's S-theorem
# step a. Convert samples to arrays of sequential 17-point means
a<-utild1group(s0, s1, radius=8, method='splitN')
# step b. Create probability vectors
b<-d1nat(a$group0,a$group1,brks=12,band=c(0,0.8)); b
# step c. Compare samples with Klimontovich's S-theorem
crit.stheorem(b$f0,b$f1)
cxds.stheorem(b$f0,b$f1)

stheoreme documentation built on May 2, 2019, 9:33 a.m.