Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PTAInterpretation
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
CI / CD
CI / CD
Pipelines
Schedules
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Hannah Middleton
PTAInterpretation
Commits
5b26dc73
Commit
5b26dc73
authored
Jun 14, 2023
by
Siyuan Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update model galaxy ptmcmc sampler to write more output
parent
508d1317
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
run_sampler.py
models/galaxy_model/run_sampler.py
+4
-4
No files found.
models/galaxy_model/run_sampler.py
View file @
5b26dc73
...
@@ -93,8 +93,8 @@ def log_likelihood(par):
...
@@ -93,8 +93,8 @@ def log_likelihood(par):
logL
=
0.
logL
=
0.
for
i
in
range
(
numberOfFrequencyBinsToUse
):
for
i
in
range
(
numberOfFrequencyBinsToUse
):
logL
+=
KDEs
[
i
]
.
logpdf
(
model
[
i
])
logL
+=
KDEs
[
i
]
.
logpdf
(
model
[
i
])
-
0.5
*
np
.
log10
(
2.
*
np
.
pi
)
print
(
model
,
logL
)
#
print(model,logL)
return
logL
[
0
]
return
logL
[
0
]
...
@@ -140,10 +140,10 @@ KDEs = makeKDEs(samples, numberOfFrequencyBinsToUse)
...
@@ -140,10 +140,10 @@ KDEs = makeKDEs(samples, numberOfFrequencyBinsToUse)
x0
=
np
.
array
([
-
2.8
,
-
0.2
,
11.25
,
-
1.25
,
0.
,
0.025
,
0.8
,
0.
,
0.
,
1.
,
0.
,
-
0.5
,
0.
,
8.25
,
1.
,
0.4
,
0.5
,
0.
])
x0
=
np
.
array
([
-
2.8
,
-
0.2
,
11.25
,
-
1.25
,
0.
,
0.025
,
0.8
,
0.
,
0.
,
1.
,
0.
,
-
0.5
,
0.
,
8.25
,
1.
,
0.4
,
0.5
,
0.
])
ndim
=
len
(
x0
)
ndim
=
len
(
x0
)
cov
=
np
.
diag
(
np
.
ones
(
ndim
)
*
0.01
**
2
)
cov
=
np
.
diag
(
np
.
ones
(
ndim
)
*
0.01
**
2
)
N
=
1000
# 1000
000
N
=
1000000
sampler
=
ptmcmc
(
ndim
,
log_likelihood
,
log_prior
,
cov
,
outDir
=
'./output'
,
resume
=
False
)
sampler
=
ptmcmc
(
ndim
,
log_likelihood
,
log_prior
,
cov
,
outDir
=
'./output'
,
resume
=
False
)
sampler
.
sample
(
x0
,
N
,
SCAMweight
=
30
,
AMweight
=
15
,
DEweight
=
50
)
sampler
.
sample
(
x0
,
N
,
SCAMweight
=
30
,
AMweight
=
15
,
DEweight
=
50
,
isave
=
100
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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