Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Andrew Strong
galplot
Commits
4ade79ae
Commit
4ade79ae
authored
Jul 12, 2020
by
Andrew Strong
Browse files
gen_source_population.cc: log likelihood using sensitivity file added
parent
da6c69ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
source/gen_source_population.cc
View file @
4ade79ae
...
...
@@ -16,7 +16,7 @@ int Galplot::gen_source_population()
unsigned
seed
;
double
logL
;
//AWS20060119
double
logL_sensitivity_file
;
//AWS20200712
cout
<<
" >>>> gen_source_population "
<<
endl
;
txt_stream
<<
" >>>> gen_source_population "
<<
endl
;
...
...
@@ -423,6 +423,8 @@ int Galplot::gen_source_population()
logL+= - sourcepop1.dlnN_dlnS [ii] + sourcepop2.dlnN_dlnS [ii] * log(sourcepop1.dlnN_dlnS[ii]);
}
for (ii=0;ii< sourcepop1.n_dlnN_dlnS;ii++)
{
if( sourcepop1.dlnN_dlnS[ii]>0 || sourcepop2.dlnN_dlnS[ii]>0 )
...
...
@@ -458,6 +460,15 @@ int Galplot::gen_source_population()
&&
sourcepop5
.
dlnN_dlnS
[
ii
]
>
0.0
)
// AWS20111011
logL
+=
-
sourcepop5
.
dlnN_dlnS
[
ii
]
+
sourcepop4
.
dlnN_dlnS
[
ii
]
*
log
(
sourcepop5
.
dlnN_dlnS
[
ii
]);
// AWS20111011
}
logL_sensitivity_file
=
0.0
;
for
(
ii
=
0
;
ii
<
sourcepop5
.
n_dlnN_dlnS
;
ii
++
)
// AWS20200712
{
if
(
sourcepop5
.
dlnN_dlnS_soplimit
[
ii
]
>
0.0
)
logL_sensitivity_file
+=
-
sourcepop5
.
dlnN_dlnS_soplimit
[
ii
]
+
sourcepop4
.
dlnN_dlnS
[
ii
]
*
log
(
sourcepop5
.
dlnN_dlnS_soplimit
[
ii
]);
}
txt_stream
<<
"sourcepop5.n_dlnN_dlnS="
<<
sourcepop5
.
n_dlnN_dlnS
<<
endl
;
//AWS20111011
txt_stream
<<
"sourcepop4.n_dlnN_dlnS="
<<
sourcepop4
.
n_dlnN_dlnS
<<
endl
;
//AWS20111011
...
...
@@ -538,7 +549,8 @@ int Galplot::gen_source_population()
txt_stream
<<
" lat_min2="
<<
galplotdef
.
lat_min2
;
txt_stream
<<
" lat_max2="
<<
galplotdef
.
lat_max2
;
txt_stream
<<
" log likelihood "
<<
logL
<<
endl
;
txt_stream
<<
" log likelihood using user-defined sensitivity = "
<<
logL
;
txt_stream
<<
" log likelihood using sensitivity file = "
<<
logL_sensitivity_file
<<
endl
;
// short form
txt_stream
<<
" "
<<
sourcepop5
.
density0
;
...
...
@@ -557,6 +569,8 @@ int Galplot::gen_source_population()
txt_stream
<<
" "
<<
galplotdef
.
lat_max2
;
txt_stream
<<
" "
<<
logL
;
txt_stream
<<
" "
<<
logL_sensitivity_file
;
txt_stream
<<
" logL statistics"
<<
endl
;
...
...
@@ -576,6 +590,15 @@ int Galplot::gen_source_population()
&&
sourcepop5
.
dlnN_dlnS
[
ii
]
>
0.0
)
// AWS20111011
logL
+=
-
sourcepop5
.
dlnN_dlnS
[
ii
]
+
sourcepop6
.
dlnN_dlnS
[
ii
]
*
log
(
sourcepop5
.
dlnN_dlnS
[
ii
]);
// AWS20111011
}
logL_sensitivity_file
=
0.0
;
for
(
ii
=
0
;
ii
<
sourcepop5
.
n_dlnN_dlnS
;
ii
++
)
// AWS20200712
{
if
(
sourcepop5
.
dlnN_dlnS_soplimit
[
ii
]
>
0.0
)
logL_sensitivity_file
+=
-
sourcepop5
.
dlnN_dlnS_soplimit
[
ii
]
+
sourcepop6
.
dlnN_dlnS
[
ii
]
*
log
(
sourcepop5
.
dlnN_dlnS_soplimit
[
ii
]);
}
txt_stream
<<
"sourcepop5.n_dlnN_dlnS="
<<
sourcepop5
.
n_dlnN_dlnS
<<
endl
;
//AWS20111011
txt_stream
<<
"sourcepop6.n_dlnN_dlnS="
<<
sourcepop6
.
n_dlnN_dlnS
<<
endl
;
//AWS20111011
...
...
@@ -656,7 +679,8 @@ int Galplot::gen_source_population()
txt_stream
<<
" lat_min2="
<<
galplotdef
.
lat_min2
;
txt_stream
<<
" lat_max2="
<<
galplotdef
.
lat_max2
;
txt_stream
<<
" log likelihood "
<<
logL
<<
endl
;
txt_stream
<<
" log likelihood using user-defined sensitivity = "
<<
logL
;
txt_stream
<<
" log likelihood using sensitivity file = "
<<
logL_sensitivity_file
<<
endl
;
// short form
txt_stream
<<
" "
<<
sourcepop5
.
density0
;
...
...
@@ -675,6 +699,7 @@ int Galplot::gen_source_population()
txt_stream
<<
" "
<<
galplotdef
.
lat_max2
;
txt_stream
<<
" "
<<
logL
;
txt_stream
<<
" "
<<
logL_sensitivity_file
;
txt_stream
<<
" logL statistics"
<<
endl
;
//---------------------------------------------------------
...
...
@@ -694,6 +719,15 @@ int Galplot::gen_source_population()
logL
+=
-
sourcepop5
.
dlnN_dlnS
[
ii
]
+
sourcepop7
.
dlnN_dlnS
[
ii
]
*
log
(
sourcepop5
.
dlnN_dlnS
[
ii
]);
// AWS20111011
}
logL_sensitivity_file
=
0.0
;
for
(
ii
=
0
;
ii
<
sourcepop5
.
n_dlnN_dlnS
;
ii
++
)
// AWS20200712
{
if
(
sourcepop5
.
dlnN_dlnS_soplimit
[
ii
]
>
0.0
)
logL_sensitivity_file
+=
-
sourcepop5
.
dlnN_dlnS_soplimit
[
ii
]
+
sourcepop7
.
dlnN_dlnS
[
ii
]
*
log
(
sourcepop5
.
dlnN_dlnS_soplimit
[
ii
]);
}
txt_stream
<<
"sourcepop5.n_dlnN_dlnS="
<<
sourcepop5
.
n_dlnN_dlnS
<<
endl
;
//AWS20111011
txt_stream
<<
"sourcepop7.n_dlnN_dlnS="
<<
sourcepop7
.
n_dlnN_dlnS
<<
endl
;
//AWS20111011
...
...
@@ -774,7 +808,8 @@ int Galplot::gen_source_population()
txt_stream
<<
" lat_min2="
<<
galplotdef
.
lat_min2
;
txt_stream
<<
" lat_max2="
<<
galplotdef
.
lat_max2
;
txt_stream
<<
" log likelihood "
<<
logL
<<
endl
;
txt_stream
<<
" log likelihood using user-defined sensitivity = "
<<
logL
;
txt_stream
<<
" log likelihood using sensitivity file = "
<<
logL_sensitivity_file
<<
endl
;
// short form
txt_stream
<<
" "
<<
sourcepop5
.
density0
;
...
...
@@ -793,6 +828,7 @@ int Galplot::gen_source_population()
txt_stream
<<
" "
<<
galplotdef
.
lat_max2
;
txt_stream
<<
" "
<<
logL
;
txt_stream
<<
" "
<<
logL_sensitivity_file
;
txt_stream
<<
" logL statistics"
<<
endl
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment