POV-Ray : Newsgroups : povray.advanced-users : Problems using/graphing internal sum function : Re: Problems using/graphing internal sum function Server Time
29 Jan 2023 06:40:50 EST (-0500)
  Re: Problems using/graphing internal sum function  
From: Bald Eagle
Date: 7 Nov 2022 21:55:00
Message: <web.6369c3f3a3234851f9dae3025979125@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> Have I broken POV-Ray _*AGAIN*_???!

Nope, just me glossing over the fact that sum doesn't have a step value, because
its default is one.
Tired brain does not listen to very little inner voice pointing out exactly

"The iteration variable is incremented by one for each step, but its initial and
final value may be any value"

So, what I needed to do was:

#declare NDist_cdf2 = function (N, mu, sigma) {sum (i, 0, N*100, NDist (i/100,
mu, sigma))}

So at present, a can take a pdf, get the cdf, and even transpose it to its
inverse function.  :)

Now to figure out how to properly weigh the sample points and I think I should
have a semi-workable / partial importance sampling algorithm.

Like ...  7 years after clipka wanted one.

I'm glad I wrote that equation graphing scene way back when, but I also think I
need to debug my axis-labeling code.

Post a reply to this message

Download 'importancesamplingtest1.png' (64 KB)

Preview of image 'importancesamplingtest1.png'


Copyright 2003-2021 Persistence of Vision Raytracer Pty. Ltd.