TRK Regression Calculator


Input Data

Select Data Type:



Format: One data point per line: From left to right, list the independent (x) values followed by their error bars (uncertainties), then the dependent (y) values followed by their error bars, seperated by white space.

Weights, if unequal, should be included on the same line, furthest to the right, again separated by white space.

Plot Data

Once the input data has been entered, plot it by mousing over the plot area. The plot can be panned over, and a zoom tool can be used by scrolling.

This can be used as a starting point to estimate the type of model to fit to the data.

Model Data

Model y(x):



Here, select a function to model y(x). Depending on the chosen function, either x or log10 x is the "pivot point" depending on which model function is selected.

In the box to the right, enter your guess for the model function parameters a0 , a1 , a2 , etc. For example, in the linear model case, a0 corresponds to the y-intercept, and a1 to the slope.

Finally, enter guesses for the slop (extrinsic scatter of the data) along the x axis
and the y axis, as the last two lines (If unsure, guesses of about 1 are a safe bet) of this box.


For large datasets and/or for non-listed custom functions,
it is recommended to use the C++ source code (documentation included) here.


Input Initial Guess for Model Function Parameters (Including Slop):


Determine Pivot Point of Model (Optional):


If possible, by determining the pivot point of the model, the fitted model parameters can be made to be uncorrelated.



Model Bayesian Prior Distributions of Model Function Parameters (Optional):

If you have some prior knowledge of the distribution(s) of your model function's parameters, this is where you can implement it.

Format: One model parameter per line. For each line, list the lower bound for the parameter (or an "x" if there is none), followed by the upper bound (or an "x" if there is none), followed by the mean and the standard deviation of the Gaussian (or two "x"s in their place if the prior is flat), all seperated by white space.

In total, each line will have four elements (either numbers or "x"s if no prior provided) seperated by white space. For example, a prior with lower bound of 0, no upper bound, and a Gaussian with μ = 1, σ = 2 would have a line of "0 x 1 2".

For custom priors, use the source code (with documentation included).
Pictured is a Gaussian prior distribution with μ = 1, σ = 2, and an upper bound of 3.

Input Priors:


Select Fitting Algorithm

Optimize Fitting Scale?


Select scale: (1.0 by default):

Generate Model Parameter Distributions/Uncertainties?

Selected Fitting Algorithm:


  1. Optimize fitting scale using TRK correlation coefficient (§2.5.1, Trotter et al., in preparation)
  2. Find best fit at this scale by maximizing TRK Likelihood with downhill simplex method (§2.5.1)
  3. Generate model parameter distributions using Adaptive Markov Chain Monte Carlo sampler (§2.5.2)
  1. Optimizate fitting scale using TRK correlation coefficient (§2.5.1, Trotter et al., in preparation)
  2. Find best fit at this scale by maximizing TRK Likelihood with downhill simplex method (§2.5.1)
  1. Find best fit at chosen scale by maximizing TRK Likelihood with downhill simplex method (§2.5.1, Trotter et al., in preparation)
  2. Generate model parameter distributions using Adaptive Markov Chain Monte Carlo sampler (§2.5.2)
  1. Find best fit at chosen scale by maximizing TRK Likelihood with downhill simplex method (§2.5.1, Trotter et al., in preparation)

Perform Fit



Final model
parameters
(including slop)
Optimum, minimum
and maximum scales
Parameter uncertainties:
(- 1 2 3, + 1 2 3 σ)

Plot of Fitted Model


Shaded regions indicate the 1-, 2- and 3σslop envelopes of the model distribution.



Plot of Model Parameter Distributions


Expore the MCMC-generated probability distributions of the model parameters. Use the dropdown menu at the top left to select which parameter to display.