Example fit

Set as you wish

SetDirectory[ NotebookDirectory[]]

Read in the package

Get[ "HG1G2tools.m"]

Functions in the HG1G2tools-package and their usage notes

?formBase

?fitHG1G2

?fitHG12

?simulateErrors

?systemVersion

?giveBaseValues

Example fit

Example data is from asteroid (44)Nysa.

testData = {{0.17`,6.911`},{0.36`,6.972`},{0.63`,7.014`},{0.75`,7.033`},{0.98`,7.052`},{1.23`,7.08`},{1.62`,7.105`},{2.02`,7.126`},{4.95`,7.235`},{8.27`,7.304`},{9.78`,7.341`},{11.59`,7.385`},{12.94`,7.425`},{13.2`,7.426`},{13.27`,7.427`},{13.58`,7.433`},{13.81`,7.437`},{13.89`,7.434`},{17.16`,7.511`},{18.52`,7.524`},{19.`,7.551`},{19.4`,7.545`},{21.47`,7.599`}};

First, initialize the system (will report the basis function system version)

formBase[]

Fit H,G1,G2-system to data with default error of 0.03 mag in observations

{fit, covmat, rms} = fitHG1G2[ testData];
Print[ "Best fit linear parameters, converted to {H,G1,G2} = ", fit, " with root-mean-square error of ", rms, " mag."]

Use simulation to obtain the actual estimate for H,G1,G2-parameters with error estimates.

estimates = simulateErrors[ fit, covmat];
TableForm[ estimates, TableHeadings->{{"mean", "median", "-3σ","-2σ","σ","σ","2σ","3σ"}, {"H", "G1", "G2", "k"}}]

Fit also H,G12-system

{fit, covmat, rms} = fitHG12[ testData];
Print[ "Best fit linear parameters, converted to {H,G12} = ", fit, " with root-mean-square error of ", rms, " mag."]

Use simulation to obtain the actual estimate for H,G1,G2-parameters with error estimates.

estimates = simulateErrors[ fit, covmat];
TableForm[ estimates, TableHeadings->{{"mean", "median", "-3σ","-2σ","σ","σ","2σ","3σ"}, {"H", "G1", "G2", "k"}}]