Getting Started with NNS: Partial Moments

Fred Viole

Partial Moments

Why is it necessary to parse the variance with partial moments? The additional information generated from partial moments permits a level of analysis simply not possible with traditional summary statistics.

Below are some basic equivalences demonstrating partial moments role as the elements of variance.

Mean

set.seed(123); x=rnorm(100); y=rnorm(100)

mean(x)
## [1] 0.09040591
UPM(1,0,x)-LPM(1,0,x)
## [1] 0.09040591

Variance

var(x)
## [1] 0.8332328
#Sample Variance:
UPM(2,mean(x),x)+LPM(2,mean(x),x)
## [1] 0.8249005
#Population Variance:
(UPM(2,mean(x),x)+LPM(2,mean(x),x))*(length(x)/(length(x)-1))
## [1] 0.8332328
#Variance is also the co-variance of itself:
(Co.LPM(1,1,x,x,mean(x),mean(x))+Co.UPM(1,1,x,x,mean(x),mean(x))-D.LPM(1,1,x,x,mean(x),mean(x))-D.UPM(1,1,x,x,mean(x),mean(x)))*(length(x)/(length(x)-1))
## [1] 0.8332328

Standard Deviation

sd(x)
## [1] 0.9128159
((UPM(2,mean(x),x)+LPM(2,mean(x),x))*(length(x)/(length(x)-1)))^.5
## [1] 0.9128159

Covariance

cov(x,y)
## [1] -0.04372107
(Co.LPM(1,1,x,y,mean(x),mean(y))+Co.UPM(1,1,x,y,mean(x),mean(y))-D.LPM(1,1,x,y,mean(x),mean(y))-D.UPM(1,1,x,y,mean(x),mean(y)))*(length(x)/(length(x)-1))
## [1] -0.04372107

Pearson Correlation

cor(x,y)
## [1] -0.04953215
cov.xy=(Co.LPM(1,1,x,y,mean(x),mean(y))+Co.UPM(1,1,x,y,mean(x),mean(y))-D.LPM(1,1,x,y,mean(x),mean(y))-D.UPM(1,1,x,y,mean(x),mean(y)))*(length(x)/(length(x)-1))
sd.x=((UPM(2,mean(x),x)+LPM(2,mean(x),x))*(length(x)/(length(x)-1)))^.5
sd.y=((UPM(2,mean(y),y)+LPM(2,mean(y),y))*(length(y)/(length(y)-1)))^.5
cov.xy/(sd.x*sd.y)
## [1] -0.04953215

CDFs

P=ecdf(x)
P(0);P(1)
## [1] 0.48
## [1] 0.83
LPM(0,0,x);LPM(0,1,x)
## [1] 0.48
## [1] 0.83
#Vectorized targets:
LPM(0,c(0,1),x)
## [1] 0.48 0.83
#Joint CDF:
Co.LPM(0,0,x,y,0,0)
## [1] 0.28
#Vectorized targets:
Co.LPM(0,0,x,y,c(0,1),c(0,1))
## [1] 0.28 0.73

Numerical Integration

Partial moments are asymptotic area approximations of \(f(x)\) akin to the familiar Trapezoidal and Simpson’s rules. More observations, more accuracy…

\[[UPM(1,0,f(x))+LPM(1,0,f(x))]\asymp\frac{[F(b)-F(a)]}{[b-a]}\]

x=seq(0,1,.001);y=x^2
UPM(1,0,y)+LPM(1,0,y)
## [1] 0.3335

\[0.3333=\frac{\int_{0}^{1} x^2 dx}{1-0}\]

Bayes’ Theorem

For example, when ascertaining the probability of an increase in \(A\) given an increase in \(B\), the Co.UPM(degree.x,degree.y,x,y,target.x,target.y) target parameters are set to target.x=0 and target.y=0 and the UPM(degree,target,variable) target parameter is also set to target=0.

\[P(A|B)=\frac{Co.UPM(0,0,A,B,0,0)}{UPM(0,0,B)}\]

References

If the user is so motivated, detailed arguments and proofs are provided within the following:

*Nonlinear Nonparametric Statistics: Using Partial Moments

*Cumulative Distribution Functions and UPM/LPM Analysis

*f(Newton)

*Bayes’ Theorem From Partial Moments