@JDM: I too am in the architectural design world, like @Duarte Farrajota Ramos, and specifically I specialise in 3D modeling and BIM based parametric design workflows.
The major reason that a least square or best fit optimization wouldn't work in our field boils down to the frequent difference between what is drawn, modeled or specified and what ends up being actually constructed.
Though we all try to account for reasonable levels of uncertainty and measurement tolerances in our initial designs, there are huge random exigencies factors once construction begins.
Whether it's multiple design areas (e.g. architectural, structural, mechanical, plumbing) not quite coordinating their designs so that there are conflicts, or actual trades in the field either not following drawings or having to adjust due to existing conditions being not quite as assumed, or measured, or depicted by survey, or even a general contractor pressuring a client to substitute building elements or entire systems from those specified to another, cheaper alternative, there are often all kinds of mismatches between as-designed dimensions and as constructed measurements.
As a result, if we were to assign a logic-based approach to coping with dimensional uncertainty, it would be most likely to fail, rather than to succeed, as the only way it would be able to correctly account for all the various factors would be for someone to both quantify these AND to input them into such a system; at the moment that system is called a designer, or an architect.
Additionally, given that you're looking at existing conditions, you must bear in mind that all such building systems shift and change over time, and depending upon the materials used, often in radically noncontiguous ways - so your wall-to-wall corner angles are most likely not 90°, nor the wall-to-floor angles, and in most cases very few of your floors are actually horizontal, nor in fact are they likely to be truly planar.
From the design perspective, the correct answer is to produce individual elements whose production dimensions slightly exceed the expected conditions, and which combine into an adjustable system rather than a monolithic assembly which is dimensionally fixed, and then when installing said system (or replacing existing elements) you note where the dimensions say V.I.F. (Verify In Field) and where necessary, cut elements to measure.
Heck, depending upon the construction system used in your apartment, and the climate, humidity and season where you are, even if your dimensions were PERFECT when initially measured, they might subsequently be significantly off some months later when you were ready to install your new elements.