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.
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
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
sd(x)
## [1] 0.9128159
((UPM(2,mean(x),x)+LPM(2,mean(x),x))*(length(x)/(length(x)-1)))^.5
## [1] 0.9128159
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
PM.matrix(LPM.degree = 1,UPM.degree = 1,target = 'mean', variable = cbind(x,y), pop.adj = TRUE)
## $clpm
## x y
## x 0.4033078 0.1559295
## y 0.1559295 0.3939005
##
## $cupm
## x y
## x 0.4299250 0.1033601
## y 0.1033601 0.5411626
##
## $dlpm
## x y
## x 0.0000000 0.1469182
## y 0.1560924 0.0000000
##
## $dupm
## x y
## x 0.0000000 0.1560924
## y 0.1469182 0.0000000
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
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
plot(ecdf(x))
points(sort(x),LPM(0,sort(x),x),col='red')
legend('left',legend=c('ecdf','LPM.CDF'),fill=c('black','red'),border=NA,bty='n')
# 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
# Continuous CDF:
plot(sort(x),LPM.ratio(1,sort(x),x),type = 'l',col='blue',lwd=3,xlab="x")
NNS.PDF(degree=1,x)
## [1] 0.0001908930 0.0003890644 0.0004040456 0.0004199092 0.0004367259
## [6] 0.0004545735 0.0004735381 0.0005772753 0.0008239690 0.0009981972
## [11] 0.0010426466 0.0010901329 0.0011409394 0.0012343120 0.0015481614
## [16] 0.0018394307 0.0019554939 0.0023281082 0.0026980593 0.0028413740
## [21] 0.0029964212 0.0031645178 0.0033471707 0.0040395453 0.0051709046
## [26] 0.0059441701 0.0069053105 0.0083045104 0.0100784620 0.0121288608
## [31] 0.0134592742 0.0142463818 0.0151046310 0.0160428638 0.0170713400
## [36] 0.0187201632 0.0218207201 0.0250308509 0.0277794175 0.0308552001
## [41] 0.0338661243 0.0373091886 0.0406145432 0.0436071170 0.0469758898
## [46] 0.0502014118 0.0533737022 0.0561135147 0.0578116164 0.0589675388
## [51] 0.0601306644 0.0610643465 0.0615105251 0.0616324186 0.0613707470
## [56] 0.0606553320 0.0595789134 0.0581541226 0.0565093857 0.0546160165
## [61] 0.0520835468 0.0489036070 0.0458203745 0.0431387143 0.0403293419
## [66] 0.0377013651 0.0353697312 0.0327864978 0.0305357162 0.0285494583
## [71] 0.0261478803 0.0235917898 0.0213413772 0.0195198159 0.0174875526
## [76] 0.0156999908 0.0144169658 0.0130499470 0.0116479213 0.0101170497
## [81] 0.0089872997 0.0082425271 0.0071881190 0.0063770598 0.0060450778
## [86] 0.0053094942 0.0041889701 0.0035465574 0.0033628737 0.0030646939
## [91] 0.0026551018 0.0021707062 0.0018155726 0.0017077244 0.0016301362
## [96] 0.0015577189 0.0014780900 0.0011915263 0.0009296535 0.0008033076
## [101] 0.0003484623
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}\] For the total area, not just the definite integral, simply sum the partial moments: \[[UPM(1,0,f(x))+LPM(1,0,f(x))]\asymp\left\lvert{\int_{a}^{b} f(x)dx}\right\rvert\]
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)}\]
If the user is so motivated, detailed arguments and proofs are provided within the following:
*Nonlinear Nonparametric Statistics: Using Partial Moments