Jump to content

Recommended Posts

Posted (edited)

For those of you who (understandably) still find this a bit too abstract, I’ve added another example to the Example folder: InteractiveCircleFit.au3 (it’s in German, but that shouldn’t be too much of a problem)

With this script, the user clicks on any points on the canvas, and the script uses those points to fit a circle that best matches them:

image.jpeg.69a530c684143b5bd10f45fa7901a678.jpeg

In my opinion, this example is very useful because it allows you to quickly visualize many aspects of adjustment analysis:

- What are observations, and what are parameters?
- What are these "residuals"?
- What do the standard deviations mean?
- What exactly is being "adjusted" here?
- What does "robust adjustment" mean?

Just play around with it (the new release is on GitHub).

Note on authorship: Since I’m not really a visual person and know absolutely nothing about graphics in AutoIt, I relied heavily on Claude for this sample script.
I’m very pleased with the result and glad that Claude fully understood how to use my UDF.

Edited by AspirinJunkie
  • 1 month later...
Posted

Adjustment UDF v26.4 — Release Notes

This release ships a complete interactive regression tool as an example, significantly faster robust estimation, and several new diagnostic and statistics features. A number of numerical and code-level bugs have also been fixed.

Download: Release v26.4 on GitHub


Highlight: Interactive Regression

regression.thumb.webp.8c9833d63065e6a4a1efe0970ba63e6b.webp

The new example examples/InteractiveRegression.au3 is a complete GUI tool for least-squares curve fitting. It bundles all of the UDF's core capabilities into a single interactive surface — and works as a learning tool: tweak the modes and data, and you can see directly in the plot how error assumptions, weighting, and model choice change the result.

Features:

  • Four regression modes: Normal (OLS/WLS), Orthogonal (TLS), Deming, York
  • Symbolic formula input with automatic parameter and observation detection (e.g. A * #X + B)
  • Editable tables for data and parameters, with Tab/Enter/arrow-key navigation and Excel-compatible multi-cell paste
  • Live plot with data points, fitted curve, residual lines, and optional 1σ/2σ confidence band (GDI+)
  • Robust estimation with all six M-estimators of the UDF
  • CSV import (auto-detect separator and decimal mark) and CSV export with formula metadata (round-trip)
  • Prediction with proper σ propagation
  • Outlier highlighting based on normalized residuals
  • "σ · s₀" button for global variance-factor rescaling of σ inputs


Performance: Faster Robust Estimation

Iteratively Reweighted Least Squares (IRLS) dominates runtime on large problems or when many iterations are needed. Several optimizations cut robust-estimation runtime substantially without affecting accuracy:

  • Warm-start the Gauss-Newton inner loop between IRLS iterations
  • Cap inner GN/LM iterations during re-solves
  • Skip pre-VCE state reset in single-pass mode
  • Default IRLS convergence tolerance loosened (1e-3 → 1e-2)
  • Cascade-init (Huber → redescending) is off by default but still available via cascadeInit


New Features

Statistics

  • Parameter correlation matrix available on demand
  • Condition number of the normal-equations matrix exposed routinely (previously only in the SVD fallback)
  • Sanity check tr(R) = f surfaces silently broken redundancy numbers

Diagnostics

  • Iterative data snooping with soft downweighting (instead of hard outlier removal)
  • External reliability (opt-in): minimum detectable bias δ₀ᵢ and parameter effect ∇xᵢ of every undetected outlier

Convergence

  • Gradient test ‖g(x)‖ < tol is enforced additionally when restrictions are present
  • Parameter-correction tolerance scales with parameter magnitude (avoids false convergence for very small parameters)

Solver / Robust

  • Cascade-init Huber → redescending (MM-estimator) as an optional mode
  • Initial Marquardt damping factor lmTau is now configurable


Bug Fixes

VCE / Robust

  • Statistics are refreshed with the final weights after VCE convergence
  • σ̂² is clipped at the MIN_SIGMA2 floor instead of being reset to 1.0
  • Active VCE forces the weighted solve path; clipped σ̂² is now correctly reported to the caller as non-convergence
  • MAD scale uses the a-priori 1/σᵢ instead of the live whitening vector
  • robustParams are auto-filled with defaults when the caller leaves them Null
  • __adj_initWeights used to skip weight init for σ=1 + multi-VCE-group → fixed

Statistics / Diagnostics

  • diag(Qvv) and diag(Qŷ) are floored at 0 before sqrt (previously caused NaN on machine-precision negative values)
  • Pope statistic now correctly uses the τ distribution instead of Student-t
  • Baarda/Pope p-values are computed in a numerically stable way (no catastrophic cancellation for large w/τ)

Solver

  • LM convergence test on the GLM/CLS path is now residual-based (r2sum) instead of parameter-based
  • Step-size scaling for numerical differentiation smooth-blends across regimes instead of switching hard

API

  • _adj_setInitialValue now creates missing parameters instead of erroring
  • _adj_removeObs resets _prepareRunCount correctly; avoids a crash on the next solve call

Code Quality

  • Several undeclared locals in AdjustmentStats / AdjustmentDiagnostics that leaked into the ByRef caller scope have been fixed
  • Au3Check cleanup across all UDF and example files


Compatibility

Fully backward compatible with v26.3.x. No API changes other than additions. Default behavior is unchanged — the performance-related default tweaks affect robust estimation only and remain conservative (see _adj_robustDefaults).


Download

>>> Download release v26.4 from GitHub <<<

Source code and issue tracker: https://github.com/Sylvan86/autoit-adjustment-udf
 

Posted

@water could you take a look here.
Maybe should be added to https://www.autoitscript.com/wiki/User_Defined_Functions
?

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Posted
1 hour ago, AspirinJunkie said:

This release ships a complete interactive regression tool as an example, significantly faster robust estimation, and several new diagnostic and statistics features. A number of numerical and code-level bugs have also been fixed.

great job
Thanks

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Posted
On 4/30/2026 at 1:16 PM, mLipok said:

@water could you take a look here.
Maybe should be added to https://www.autoitscript.com/wiki/User_Defined_Functions
?

Done 🙂 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...