cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

## Could anyone explain what is going on here? :)  1-Newbie

## Could anyone explain what is going on here? :) 1 ACCEPTED SOLUTION

Accepted Solutions  20-Turquoise
(To:ptc-4935235)
 Ivan Karachinsky wrote:I understand this is normal distribution density function but need to figure out what the variables stand for exactly. M, L, K, R1 and R2 The normally generated numbers are just there to generate some data for testing - you could equally well replace rnorm with runif or any other distribution.

The function Phi calculates the cumulative distribution for the data, that is the number of values less than x. The function f computes the difference in the cumulative distribution between x and x+L. If you make L small enough, then f approximates to the probability density at x.

As for the variables, ...

m is the count of all values of data < x+L

k is the count of all values of data < x

L is the interval over which to compute the difference in cumulative distribution

R1 is k normalized to the total number of points

R2 is m normalized to the total number of points

I'm a little surprised that f is written like that given the existence of Phi, as the whole thing could have been written as (Phi(x+L)-Phi(x))/L

Stuart

6 REPLIES 6  20-Turquoise
(To:ptc-4935235)

Where is "here"? I can't see anything in your post.

Stuart  1-Newbie
(To:StuartBruff)   1-Newbie
(To:ptc-4935235)

I understand this is normal distribution density function but need to figure out what the variables stand for exactly. M, L, K, R1 and R2  20-Turquoise
(To:ptc-4935235)
 Ivan Karachinsky wrote:I understand this is normal distribution density function but need to figure out what the variables stand for exactly. M, L, K, R1 and R2 The normally generated numbers are just there to generate some data for testing - you could equally well replace rnorm with runif or any other distribution.

The function Phi calculates the cumulative distribution for the data, that is the number of values less than x. The function f computes the difference in the cumulative distribution between x and x+L. If you make L small enough, then f approximates to the probability density at x.

As for the variables, ...

m is the count of all values of data < x+L

k is the count of all values of data < x

L is the interval over which to compute the difference in cumulative distribution

R1 is k normalized to the total number of points

R2 is m normalized to the total number of points

I'm a little surprised that f is written like that given the existence of Phi, as the whole thing could have been written as (Phi(x+L)-Phi(x))/L

Stuart  1-Newbie
(To:StuartBruff)

Thank you very much, Stuart!  20-Turquoise
(To:ptc-4935235)

Не за что, Ива́н. Announcements
Check out the latest