Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: convolution/cumulative


From   "Andreas Aschbacher" <[email protected]>
To   [email protected]
Subject   st: convolution/cumulative
Date   Thu, 25 Mar 2004 11:55:34 +0100 (MET)

Dear fellows !

maybe the following program is useful for someone:
/ computing convolution-integral and cumulative-function  /
I seek for possibilities to show that dosis-distributions in population
are composed via convolution of two functions(lognormal ?)
one function represents background - that is radioactivity which is 
always around us  and not-naturally radioactivity which is for example
radioactivity in a hospital.
physically both allotments are the sum - but !!! probability-distribution in
human-population
is - as we all suppose - composed via convolution.(Bayes-statistic)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+
clear
set more off
set obs 100
gen d1 =.
scalar m1 = 3
scalar m2 = 3.5
forvalues i = 1(1)100 {
gen x = [_n]
gen x1 = x*.1

local j = `i' * .1

if `i' == 1 {
   local j = .11
  di `j'
}
di  `j'
di  `j'

gen double y = exp(-(log((`j') - x1) - m1 )^2/2) *exp(-(log((`j') - x1) -
m2)^2/2)
/standard-deviation = 1 for both /
replace y = 0 if x1 > `j'
di `j'
integ y x1 ,gen(Sy)
replace d1 = Sy if [_n] == `i'
drop Sy y x x1
}
gen x = [_n]
gen x1 = x*.1

integ d1 x1,gen(Sy_1)
twoway line d1 x1||line Sy_1 x1

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
greetings from austria
andreas aschbacher

-- 
+++ NEU bei GMX und erstmalig in Deutschland: T�V-gepr�fter Virenschutz +++
100% Virenerkennung nach Wildlist. Infos: http://www.gmx.net/virenschutz

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index