두 개의 랜덤 변수가 있습니다. 여기서 U ( 0 , 은 균일 한 0-1 분포입니다.
그런 다음 프로세스가 생성됩니다.
지금,가 폐쇄 된 형태의 발현이인지 궁금 의 이론적 인 75 %의 분위수 P ( X ) 주어진 대한 X ∈ ( 0 , 2 π ) I를 가정 --i 컴퓨터와 P ( x ) 의 많은 실현으로 할 수 있지만 닫힌 형식을 선호합니다.
두 개의 랜덤 변수가 있습니다. 여기서 U ( 0 , 은 균일 한 0-1 분포입니다.
그런 다음 프로세스가 생성됩니다.
지금,가 폐쇄 된 형태의 발현이인지 궁금 의 이론적 인 75 %의 분위수 P ( X ) 주어진 대한 X ∈ ( 0 , 2 π ) I를 가정 --i 컴퓨터와 P ( x ) 의 많은 실현으로 할 수 있지만 닫힌 형식을 선호합니다.
답변:
This problem can quickly be reduced to one of finding the quantile of a trapezoidal distribution.
사다리꼴 분포의 분위수
하자 and are independent and distributions. Assume without loss of generality that . Then, the density of is formed by convolving the densities of and . This is readily seen to be a trapezoid with vertices , , and .
The quantile of the distribution of , for any is, thus,
Back to the case at hand
The above already provides enough to give a closed-form expression. All we need is to break into two cases and to determine which plays the role of and which plays the role of above. (The factor of 2 here is only to compensate for the divisions by two in the definition of .)
For , on , we set and and get
The quantiles
Below are two heatmaps. The first shows the quantiles of the distribution of for a grid of running from to . The -coordinate gives the probability associated with each quantile. The colors indicate the value of the quantile with dark red indicating very large (positive) values and dark blue indicating large negative values. Thus each vertical strip is a (marginal) quantile plot associated with .
The second heatmap below shows the quantiles themselves, colored by the corresponding probability. For example, dark red corresponds to and dark blue corresponds to and . Cyan is roughly and . This more clearly shows the support of each distribution and the shape.
Some sample R
code
The function qproc
below calculates the quantile function of for a given . It uses the more general qtrap
to generate the quantiles.
# Pointwise quantiles of a random process:
# P(x) = a_1 sin(x) + a_2 cos(x)
# Trapezoidal distribution quantile
# Assumes X = U + V where U~Uni(-a,a), V~Uni(-b,b) and a >= b
qtrap <- function(p, a, b)
{
if( a < b) stop("I need a >= b.")
s <- 2*(p<=1/2) - 1
p <- ifelse(p<= 1/2, p, 1-p)
s * ifelse( p < b/2/a, sqrt(8*a*b*p)-a-b, (2*p-1)*a )
}
# Now, here is the process's quantile function.
qproc <- function(p, x)
{
s <- abs(sin(x))
c <- abs(cos(x))
a <- ifelse(s>c, s, c)
b <- ifelse(s<c, s, c)
qtrap(p,a/2, b/2) + 0.5*(sin(x)+cos(x))
}
Below is a test with the corresponding output.
# Test case
set.seed(17)
n <- 1e4
x <- -pi/8
r <- runif(n) * sin(x) + runif(n) * cos(x)
# Sample quantiles, then actual.
> round(quantile(r,(0:10)/10),3)
0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
-0.380 -0.111 -0.002 0.093 0.186 0.275 0.365 0.453 0.550 0.659 0.917
> round(qproc((0:10)/10, x),3)
[1] -0.383 -0.117 -0.007 0.086 0.178 0.271 0.363 0.455 0.548
[10] 0.658 0.924