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
dc52bdd3
Commit
dc52bdd3
authored
Jun 12, 2023
by
Hannah Middleton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log10 freq fix
parent
c3553a1b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
run_sampler.py
models/galaxy_model/run_sampler.py
+13
-3
No files found.
models/galaxy_model/run_sampler.py
View file @
dc52bdd3
...
...
@@ -67,11 +67,10 @@ def log_prior(par):
def
log_likelihood
(
par
):
M1
=
np
.
linspace
(
9
,
12
,
25
)
q
=
np
.
linspace
(
0.25
,
1
,
10
)
z
=
np
.
linspace
(
0.
,
1.5
,
5
)
f
=
frequencies
f
=
np
.
atleast_1d
([
np
.
log10
(
fi
)
for
fi
in
frequencies
])
initpar
=
dict
(
Phi0
=
par
[
0
],
PhiI
=
par
[
1
],
M0
=
par
[
2
],
...
...
@@ -95,7 +94,8 @@ def log_likelihood(par):
logL
=
0.
for
i
in
range
(
numberOfFrequencyBinsToUse
):
logL
+=
KDEs
[
i
]
.
logpdf
(
model
[
i
])
return
logL
print
(
model
,
logL
)
return
logL
[
0
]
...
...
@@ -119,6 +119,11 @@ bounds=[(-3.4,-2.4),
(
0.01
,
0.99
),
(
-
2.
,
2.
)]
# read in the data
numberOfFrequencyBinsToUse
=
5
frequencies
,
samples
=
readChains
(
numberOfFrequencyBinsToUse
)
...
...
@@ -126,6 +131,11 @@ frequencies, samples = readChains(numberOfFrequencyBinsToUse)
# make the kdes
KDEs
=
makeKDEs
(
samples
,
numberOfFrequencyBinsToUse
)
#parTest = np.array([-2.78,-0.28,11.3,-1.24,-0.04,0.04,0.10,1.27,0.01,0.39,-0.2,-1.91,0.01,8.42,1.03,0.38,0.51,-0.7])
#log_likelihood(parTest)
#exit()
# ptmcmc things
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
)
...
...
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