hyper.fit
3D plot
Methods
Below are the available methods for optim, LA and LD.
Optim :
LaplaceApproximation (LA) :
LaplacesDemon (LD) :
About
hyper.fit is a top level line fitting function that uses downhill searches (optim/LaplaceApproximation) or MCMC (LaplacesDemon) to search out the best fitting parameters for a hyperplane (minimum a 1D line for 2D data), including the intrinsic scatter as part of the fit.
Usage
Specify data first by using Example Data or Uploaded Data. Change the fitting parameters under Fit Options and click Recalculate to produce a different fit. The appearance of the plot can be changed under Plot Options.
Example Data
Example data can be used by clicking an example under Example Data. Once an example is clicked, the example data will be used in all future calculations.
Upload Data
Data may be uploaded under the Upload Data section. The file format accepted has a header with quoted column names, and with the values separated by a separator in the set [ , tab space | ; : ]. Once the data is uploaded, it can be used in all future calculations by pressing the Use button. The uploaded data may either be 2D or 3D data, and below are some rules and examples of the 2D and 3D data:
Required, Ignore, Optional.
2D | 3D |
---|---|
x | x |
y | y |
z | z |
sx | sx |
sy | sy |
sz | sz |
corxy | corxy |
corxz | corxz |
coryz | coryz |
weights | weights |
Example of 2D data (space-separated)
"x" "y" "sx" "sy" "corxy" "weights" 0.2695 0.0724 0.065 0.03 0.85 1.0 0.1615 0.0147 0.065 0.03 0.85 1.0 -0.0865 -0.151 0.065 0.03 0.85 1.0 0.8808 0.5284 0.065 0.03 0.85 1.5 -0.8177 -0.9546 0.065 0.03 0.85 1.5 0.4069 0.0901 0.065 0.03 0.85 1.0 0.4118 0.242 0.065 0.03 0.85 1.0 0.4425 -0.0621 0.065 0.03 0.85 1.0
Example of 3D data (CSV)
"x","y","z","sx","sy","sz","corxy","corxz","coryz" 0.2695,0.0724,0.0394,0.065,0.03,0.02,0.85,0,0 0.1615,0.0147,0.0529,0.065,0.03,0.02,0.85,0,0 -0.0865,-0.151,0.0224,0.065,0.03,0.02,0.85,0,0 0.8808,0.5284,0.1042,0.065,0.03,0.02,0.85,0,0 -0.8177,-0.9546,0,0.065,0.03,0.02,0.85,0,0 0.4069,0.0901,0.0191,0.065,0.03,0.02,0.85,0,0 0.4118,0.242,0.0292,0.065,0.03,0.02,0.85,0,0 0.4425,-0.0621,0.1424,0.065,0.03,0.02,0.85,0,0
Fit Options
Under Fit Options, the following parameters can be specified for the fit calculation. The names in (grey) represent the parameter names for the hyper.fit function.
(coord.type)
This specifies whether the fit should be done in terms of the normal vector to the hyperplane (coord.type="normvec") gradients defined to produce values along the vert.axis dimension (coord.type="alpha") or by the values of the angles that form the gradients (coord.type="theta"). "theta" is the default since it will tend to produce a more numerically stable fit since changes in one angle will not impact the others as much as a change in the unit vector components.
(scat.type)
This specifies whether the intrinsic scatter should be defined orthogonal to the plane (orth) or along the vert.axis of interest (vert.axis).
(doerrorscale)
If FALSE then the provided covariance are treated as it. If TRUE then the likelihood function is also allowed to rescale all errors by a uniform multiplicative value.
(itermax)
The maximum iterations to use for either the LaplaceApproximation function or LaplacesDemon function. (LA and LD only)
(algo.func)
If algo.func="optim" (default) hyper.fit will optimise using the R base optim function. If algo.func="LA" will optimise using the LaplaceApproximation function. If algo.func="LD" will optimise using the LaplacesDemon function. For both algo.func="LA" and algo.func="LD" the LaplacesDemon package will be used.
(algo.method)
Specifies the "method" argument of optim function when using algo.func="optim" (if not specified hyper.fit will use "Nelder-Mead" for optim). Specifies "Method" argument of LaplaceApproximation function when using algo.func="LA" (if not specified hyper.fit will use "NM" for LaplaceApproximation). Specifies "Algorithm" argument of LaplacesDemon function when using algo.func="LD" (if not specified hyper.fit will use "CHARM" for LaplacesDemon). When using algo.func="LD" the user can also specify further options via the Specs argument below.
(Specs)
Inputs to pass to the LaplacesDemon function. Default Specs=list(alpha.star = 0.44) option is for the default CHARM algorithm (see algo.method above). Specs can be set to NULL, but not all methods will accept this. (LD only)
Plot Options
Under Plot Options, the following parameters can change the appearance of the plot. The names in (grey) represent the parameter names for the plot.hyper.fit function.
(sigscale)
Changes the colour range of the points.
(trans)
Sets the alpha of the points.
(doellipse)
If set to TRUE, points will be displayed as ellipses. If FALSE, points are displayed as dots. Using ellipses may reduce the performance of the program.
The number of significant figures to show in the main output.
(dobar)
If set to TRUE, a bar depicting the SigScale will appear on the plot. (2D only)
(position)
Sets the position of the SigScale bar on the plot. Use Bar must be set to TRUE to enable this option. (2D only)
Acknowledgements
This website was written in the programming language R by Joseph Dunne and Aarom Robotham. It uses the library Shiny to provide the interface.