The fixed and p_fix Arguments

When using JAVELIN, it is often useful to fix one or more of the parameters to a specific value. This can be done with the fixed and p_fix arguments.

fixed is a list telling JAVELIN which parameters to fix. A 1 corresponds to a varying parameter, while 0 corresponds to a fixed parameter.

p_fix is a list of the value to fix the parameters to. The index of the parameter in fixed must correspond to the index of the value in p_fix.

The fixed and p_fix lists will have a length \(2 + 3\cdot(\rm number \, of \, lines)\), where the first two parameters are the DRW parameters, and the next three parameters are the tophat parameters for each line.

\([ \log(\sigma_{\rm DRW}), \log(\tau_{\rm DRW}), t_{\rm line1}, w_{\rm line1}, s_{\rm line2}, t_{line2}, ... ]\)

If together=False, multiple fixed and p_fix arguments can be entered in an array, with one for each line:

\([ [ \log(\sigma_{\rm DRW}), \log(\tau_{\rm DRW}), t_{\rm line1}, w_{\rm line1}, s_{\rm line1} ], [ \log(\sigma_{\rm DRW}), \log(\tau_{\rm DRW}), t_{\rm line2}, w_{\rm line2}, s_{\rm line2} ], ... ]\)

Note

If only one argument is given for fixed and p_fix, but there is more than one line, it will be used for all lines given.

Warning

If use_for_javelin=True in the DRW rejection module and fixed/p_fix arguments are given, the DRW rejection outputs will be used instead of the input values.

Here we’ll fix \(\tau_{\rm DRW}\) and the time lag of the first line \((t_{\rm line1})\):

[1]:
%matplotlib inline
import pypetal_jav.pipeline as pl
import numpy as np

line_names = ['Continuum', 'H-alpha', 'H-beta']
output_dir = 'javelin_output3/'

#Let tau=300 days and w=20 days for line1
fixed1 = [1, 0,           1,    0, 1]
p_fix1 = [0, np.log(300), 0,  20., 0]

fixed2 = [1,1,1,1,1]
p_fix2 = [0,0,0,0,0]

params = {
    'nwalker': 100,
    'nburn': 50,
    'nchain': 100,
    'fixed': [fixed1, fixed2],
    'p_fix': [p_fix1, p_fix2]
}

res = pl.run_pipeline( output_dir, line_names,
                 javelin_params=params,
                 verbose=True,
                 plot=True,
                 file_fmt='ascii',
                 lc_unit='Jy',
                 time_unit='d')

Running JAVELIN
--------------------
rm_type: spec
lagtobaseline: 0.3
laglimit: [[-1976.98849, 1976.98849], [-1976.98849, 1976.98849]]
fixed: True
p_fix: True
subtract_mean: True
nwalker: 100
nburn: 50
nchain: 100
output_chains: True
output_burn: True
output_logp: True
nbin: 50
metric: med
together: False
--------------------

start burn-in
nburn: 50 nwalkers: 100 --> number of burn-in iterations: 5000
burn-in finished
save burn-in chains to /home/stone28/pypetal/javelin_output3/H-alpha/javelin/burn_cont.txt
start sampling
sampling finished
acceptance fractions for all walkers are
0.75 0.76 0.77 0.87 0.71 0.70 0.80 0.85 0.75 0.75 0.82 0.74 0.71 0.71 0.69 0.72 0.68 0.75 0.71 0.74 0.72 0.78 0.75 0.77 0.84 0.74 0.76 0.71 0.81 0.75 0.79 0.75 0.73 0.76 0.78 0.81 0.88 0.83 0.74 0.69 0.85 0.70 0.80 0.85 0.75 0.80 0.82 0.77 0.83 0.79 0.76 0.82 0.64 0.76 0.72 0.74 0.77 0.74 0.80 0.84 0.68 0.74 0.77 0.79 0.82 0.70 0.72 0.74 0.72 0.72 0.75 0.75 0.76 0.74 0.75 0.72 0.83 0.77 0.70 0.70 0.64 0.77 0.79 0.79 0.79 0.83 0.79 0.74 0.85 0.64 0.76 0.79 0.78 0.77 0.70 0.73 0.69 0.79 0.74 0.88
save MCMC chains to /home/stone28/pypetal/javelin_output3/H-alpha/javelin/chain_cont.txt
save logp of MCMC chains to /home/stone28/pypetal/javelin_output3/H-alpha/javelin/logp_cont.txt
HPD of sigma
low:    2.330 med    2.518 hig    2.738
HPD of tau
low:  300.000 med  300.000 hig  300.000
../../_images/notebooks_javelin_fixed_5_1.png
run single chain without subdividing matrix
start burn-in
using priors on sigma and tau from continuum fitting
[[  2.33  300.   ]
 [  2.518 300.   ]
 [  2.738 300.   ]]
penalize lags longer than 0.30 of the baseline
nburn: 50 nwalkers: 100 --> number of burn-in iterations: 5000
burn-in finished
save burn-in chains to /home/stone28/pypetal/javelin_output3/H-alpha/javelin/burn_rmap.txt
start sampling
sampling finished
acceptance fractions are
0.08 0.09 0.05 0.03 0.08 0.07 0.15 0.10 0.13 0.02 0.11 0.08 0.10 0.11 0.05 0.08 0.08 0.14 0.12 0.06 0.16 0.08 0.06 0.12 0.14 0.11 0.12 0.09 0.09 0.09 0.13 0.09 0.10 0.16 0.05 0.10 0.06 0.00 0.04 0.04 0.16 0.11 0.07 0.02 0.19 0.11 0.05 0.07 0.16 0.08 0.11 0.08 0.08 0.10 0.12 0.07 0.14 0.12 0.03 0.07 0.12 0.06 0.16 0.09 0.15 0.13 0.09 0.15 0.00 0.08 0.08 0.10 0.09 0.06 0.09 0.06 0.01 0.02 0.11 0.13 0.05 0.11 0.09 0.09 0.16 0.09 0.13 0.10 0.07 0.07 0.13 0.16 0.04 0.10 0.13 0.11 0.09 0.11 0.07 0.09
save MCMC chains to /home/stone28/pypetal/javelin_output3/H-alpha/javelin/chain_rmap.txt
save logp of MCMC chains to /home/stone28/pypetal/javelin_output3/H-alpha/javelin/logp_rmap.txt
HPD of sigma
low:    2.482 med    2.952 hig    3.578
HPD of tau
low:  300.000 med  300.000 hig  300.000
HPD of lag_H-alpha
low: -1905.800 med  181.372 hig 1920.202
HPD of wid_H-alpha
low:   20.000 med   20.000 hig   20.000
HPD of scale_H-alpha
low:    0.631 med    1.001 hig    1.416
../../_images/notebooks_javelin_fixed_5_3.png
covariance matrix calculated
covariance matrix decomposed and updated by U
../../_images/notebooks_javelin_fixed_5_5.png
start burn-in
nburn: 50 nwalkers: 100 --> number of burn-in iterations: 5000
burn-in finished
save burn-in chains to /home/stone28/pypetal/javelin_output3/H-beta/javelin/burn_cont.txt
start sampling
sampling finished
acceptance fractions for all walkers are
0.71 0.75 0.81 0.75 0.61 0.60 0.76 0.75 0.80 0.78 0.71 0.69 0.72 0.69 0.72 0.63 0.69 0.68 0.52 0.71 0.71 0.71 0.69 0.76 0.64 0.72 0.58 0.76 0.66 0.74 0.72 0.69 0.62 0.75 0.72 0.69 0.67 0.68 0.60 0.76 0.70 0.70 0.60 0.62 0.68 0.68 0.70 0.71 0.79 0.72 0.66 0.72 0.70 0.70 0.69 0.69 0.82 0.66 0.76 0.67 0.74 0.77 0.71 0.64 0.72 0.80 0.65 0.71 0.69 0.80 0.73 0.68 0.64 0.61 0.75 0.70 0.69 0.70 0.73 0.76 0.61 0.67 0.80 0.70 0.72 0.54 0.79 0.70 0.77 0.63 0.75 0.63 0.72 0.66 0.79 0.66 0.84 0.76 0.80 0.79
save MCMC chains to /home/stone28/pypetal/javelin_output3/H-beta/javelin/chain_cont.txt
save logp of MCMC chains to /home/stone28/pypetal/javelin_output3/H-beta/javelin/logp_cont.txt
HPD of sigma
low:    1.770 med    2.162 hig    2.860
HPD of tau
low:  140.052 med  212.108 hig  384.709
../../_images/notebooks_javelin_fixed_5_7.png
run single chain without subdividing matrix
start burn-in
using priors on sigma and tau from continuum fitting
[[  1.77  140.052]
 [  2.162 212.108]
 [  2.86  384.709]]
penalize lags longer than 0.30 of the baseline
nburn: 50 nwalkers: 100 --> number of burn-in iterations: 5000
burn-in finished
save burn-in chains to /home/stone28/pypetal/javelin_output3/H-beta/javelin/burn_rmap.txt
start sampling
sampling finished
acceptance fractions are
0.03 0.08 0.00 0.09 0.05 0.10 0.13 0.08 0.03 0.07 0.15 0.06 0.06 0.04 0.07 0.05 0.04 0.08 0.06 0.09 0.08 0.08 0.04 0.02 0.11 0.12 0.14 0.07 0.04 0.02 0.04 0.02 0.04 0.12 0.08 0.11 0.13 0.14 0.10 0.10 0.02 0.07 0.06 0.02 0.08 0.02 0.03 0.12 0.05 0.02 0.04 0.12 0.00 0.01 0.09 0.12 0.07 0.13 0.06 0.06 0.06 0.00 0.07 0.08 0.06 0.14 0.08 0.03 0.11 0.02 0.02 0.04 0.10 0.13 0.11 0.08 0.03 0.08 0.05 0.09 0.08 0.15 0.11 0.05 0.06 0.06 0.12 0.06 0.09 0.00 0.11 0.14 0.06 0.07 0.10 0.15 0.11 0.11 0.07 0.00
save MCMC chains to /home/stone28/pypetal/javelin_output3/H-beta/javelin/chain_rmap.txt
save logp of MCMC chains to /home/stone28/pypetal/javelin_output3/H-beta/javelin/logp_rmap.txt
HPD of sigma
low:    1.789 med    2.161 hig    2.672
HPD of tau
low:  153.358 med  209.160 hig  276.601
HPD of lag_H-beta
low: -1727.608 med  249.556 hig 1921.832
HPD of wid_H-beta
low:    0.280 med    0.606 hig    0.983
HPD of scale_H-beta
low:    0.257 med    0.379 hig    0.616
../../_images/notebooks_javelin_fixed_5_9.png
covariance matrix calculated
covariance matrix decomposed and updated by U
../../_images/notebooks_javelin_fixed_5_11.png

We can see that for the first line, the histogram for \(\tau_{\rm DRW}\) and \(w\) are both a singular value.

Both the output figures and dictionaries are the same as in the basic tutorial. However, if any of the parameters are fixed for any of the lines, a corner plot will not be produced.