def lnprior(pars): """ Return probability of parameter values according to prior knowledge. Parameter limits should be done here through uniform prior ditributions """ logprob = (naima.uniform_prior(pars[0], 0., np.inf) + naima.uniform_prior(pars[1], -1, 5)) return logprob
def lnprior(pars): """ Return probability of parameter values according to prior knowledge. Parameter limits should be done here through uniform prior ditributions """ # Limit norm and B to be positive logprob = naima.uniform_prior(pars[0], 0., np.inf) \ + naima.uniform_prior(pars[1], -1, 5) \ + naima.uniform_prior(pars[3], 0, np.inf) return logprob
def prior_func(self, pars): ''' The prior function that encodes any previous knowledge we have about the parameter space constraints. Good choice of prior function is necessary for the fit to converge correctly. Parameter space can be best constrained from previous observations if any. Parameters: ------------ pars: list_like list of free parameters of the model Returns: --------- Uniform prior (in this case) distribution of the parameters. ''' # The order of the command line args is very imp if self.intrinsic: prior = naima.uniform_prior(pars[0], 1.7, 1.9) \ + naima.normal_prior(pars[1], 1e15, 1e16) \ + naima.uniform_prior(pars[2], 0.01, 2.1) \ + naima.uniform_prior(pars[3], 1.5e5, 2.5e5) else: prior = naima.uniform_prior(pars[0], 1.7, 1.9) \ + naima.normal_prior(pars[1], 1e15, 1e16) \ + naima.uniform_prior(pars[2], 0.01, 2.1) \ + naima.uniform_prior(pars[3], 1.5e6, 2.5e9) \ + naima.uniform_prior(pars[4], 0, 20) \ + naima.uniform_prior(pars[5], 5, 20) \ return prior
def lut_prior(pars): lnprior = (uniform_prior(pars[0], log_ampl[0], log_ampl[-1]) + uniform_prior(pars[1], alpha[0], alpha[-1]) + uniform_prior(pars[2], beta[0], beta[-1]) + uniform_prior(pars[3], log_e_max[0], log_e_max[-1]) + uniform_prior(pars[4], log_e_min[0], log_e_min[-1]) + uniform_prior(pars[5], B[0], B[-1])) return lnprior
def prior_func(self, pars): ''' The prior function that encodes any previous knowledge we have about the parameter space constraints. Good choice of prior function is necessary for the fit to converge correctly. Parameter space can be best constrained from previous observations if any. Parameters: ------------ pars: list_like list of free parameters of the model Returns: --------- Uniform prior (in this case) distribution of the parameters. ''' #The order of the command line args is very imp if self.intrinsic: prior = naima.uniform_prior(pars[0], 1.8, 2.45) \ +naima.normal_prior(pars[1], 7e15, 8e7) \ + naima.uniform_prior(pars[2], 0.1, 2.1) \ #if self.intrinsic: # prior = naima.normal_prior(pars[0], 2.3, 0.002) \ # + naima.normal_prior(pars[1], 7e15, 6.2e7) \ # + naima.uniform_prior(pars[2], 0.1, 2.1) \ # #+ naima.normal_prior(pars[3], 2.2e5, 0.9e2) \ else: prior = naima.uniform_prior(pars[0], 1.8, 2.5) \ + naima.uniform_prior(pars[1], 7e15, 8e15) \ + naima.uniform_prior(pars[2], 0.9, 2.1) \ + naima.uniform_prior(pars[3], 1.5e5, 2.5e5) \ + naima.uniform_prior(pars[4], 1, 45) \ + naima.uniform_prior(pars[5], 1, 80) return prior
def ECPL_lnprior(pars): logprob = naima.uniform_prior(pars[0], 0.0, np.inf) + naima.uniform_prior( pars[1], -1, 5 ) return logprob
def PionDecay_ECPL_lnprior(pars): logprob = naima.uniform_prior(pars[1], -1, 5) return logprob
def IC_We_lnprior(pars): logprob = naima.uniform_prior(pars[1], -1, 5) return logprob
def lnprior(pars): # Limit amplitude to positive domain logprob = naima.uniform_prior(pars[0], 0.0, np.inf) return logprob
def LP_lnprior(pars): logprob = naima.uniform_prior(pars[0], 0., np.inf) \ + naima.uniform_prior(pars[1], -1, 5) return logprob
def ECPL_lnprior(pars): logprob = naima.uniform_prior(pars[0], 0.0, np.inf) + naima.uniform_prior( pars[1], -1, 5) return logprob