Showing posts with label Causal. Show all posts
Showing posts with label Causal. Show all posts

Wednesday, 11 March 2020

Causal Analysis: Causes, Results & Correlations.

Causal Analysis.

Causal analysis is the field of experimental design and statistics pertaining to establishing cause and effect.

Typically it involves establishing three elements: corelation, sequence in time / that is, causes must occur before their proposed effect /, and a plausible physical or information-theoretical mechanism for an observed effect to follow from a possible cause, often involving one or more experiments.


Causation, functional relation.

When we have:
  a Cause Ca1,
  a Result R1,
  a Proof that C1 causes R1

Then we can say that we have a Cause - Result relation between Ca1 and R1


Correlation, probabilistic relation.

'Correlation is not causation' means that just because two things correlate does not necessarily mean that one causes the other.

As a seasonal example, just because people in the UK tend to spend more in the shops when it's cold and less when it's hot doesn't mean cold weather causes frenzied high-street spending.

A more plausible explanation would be that cold weather tends to coincide with Christmas and the new year sales.


See also, if You wish: Causal Notation.

Tuesday, 1 May 2018

Causal Notation.

Purpose.

This is a Causal Notation's initial draft, it's intended to have uses in Causal Proofs, Causal Analysis,
Causal Modelling, Causal Design, Causal Programming & Causal Automated Tests.


Additional practical notes.

This model is not detached from Reality, it applies to concurrent, non-realtime systems. Hence, we consider unknown delays in model & notation.

Are realtime systems detached from Reality?

Generally they are not - but for many solutions they are too expensive and slow to make. Hence, in many niches and solutions they are too unreal to be worthwhile.

Proving that programs or program parts will complete in a given maximum amount of time, is not possible using these tools. Using statistical-allowance of errors, including completion-time-related errors and forming contracts that way might be possible, but there's always a risk.

While time is counted very precisely by computer clocks, there are delays caused by code execution - every instruction takes a time to perform. Exact amount of delay depends on instruction(s), on processor(s) and on operating system and other software layers, if there are any.

Therefore, clock-events, objects creation and interaction are associated with delays, and response to clock-events usually is associated with delays.

Profilers, either built-in a programming language, or added manually or provided by thrid-party tools - are a good way of measuring average, worst and best delays statistically on a given hardware-software infrastructure unit.

See also, if You wish: Correctness.


Types.

Ca: a cause,
R: a result, an abstract object type that can evaluate to a boolean value,
De: discrete event, either a cause or result,
Co: a condition,
Te: a timeframe.
Cns: a conditions set,
B: a boolean expression,
Cto: a clock-events bound condition; it's state contains exact time of appearance and time of disappearance,
t: a time measured in milliseconds since beginning of year 1 A.D.
O: observer object - observes clock events, causes & conditions appearance, existence and disappearance, as well as origination, hold time, and cessation, then reacts with events that can result in cause(s) and/or condition(s) appearance and disappearance, as well as origination and cessation.


Definitions.

Cto := (t1, t2) - - Condition that appears at time t1 or a little later, and disappears at t2 or a little later,
Cto := (t, ...) - Condition that appears at a time t or a little later, and disappears when program stops,
Cto := (..., t) - Condition that appears during program's initialization, and disappears at time t or a little later,
Ten := Com - a timeframe Ten is defined as in-between of a condition Com appearance and disappearance.
Cnsn := Con1, Con2, ... - a conditions set Con is defined as a collection of conditions Con1, Con2, ...
Cnsn := Cnsm1, Cnsm2, ..., Cop1, Cop2, ... - a conditions set Cnsn,
  is defined as a collection of:
  * conditions Cop1, Cop2, ...,
  * conditions from conditions sets Cnsm1, Cnsm2, ...

Origination - an objects starts to affect Reality.
Hold - an object keeps affecting Reality.
Cessation - an object ceases to affect Reality.

Appearance - an object appears in Reality.
Existence - an object exists in Reaiity.
Disappearance - an object disappears from Reality.

In different sources - Buddhist or other - these ideas might be defined differently.

In many cases, but not all:
* appearance means origination,
* existence means hold,
* disappearance means cessation.

Can object exist and not affect Reality?
* depends on how we define a Reality,
* a part of Reality is also a Reality,
* we can play with ideas of objects with or without meaning,
* we can play with ideas of physical and nonmaterial objects,
* we can play with ideas of redefining what 'affecting' means, and with 'affecting threshold',
* does observation affect Reality?,
* ...

This has uses in modelling, for example, as models are simplified representation of interresting Reality's parts.


Appearance, Existence, Disappearance, Origination, Hold & Cessation.

Can := App Dem - a discrete event Dem makes a cause Can to appear.
Can := App Com - a condition Com makes a cause Can to appear.
Can := App Cnsm - a conditions set Cnsm makes a cause Can to appear.

when Bn : Com - condition Com appears and exists for as long as Bn is true.

Rn := Ap Dem in Tep - a result Rn evaluates to true if a discrete event Dem appears in a timeframe Tep.
Rn := Ap Com in Tep - a result Rn evaluates to true if a condition Com appears in a timeframe Tep.
Rn := Ap Cnsm in Tep - a result Rn evaluates to true if a conditions set Cnsm appears in a timeframe Tep.
Rn := Dis Cam in Tep - a result Rn evaluates to true if a cause Cam disappears in a timeframe Tep.
Rn := Dis Com in Tep - a result Rn evaluates to true if a condition Com disappears in a timeframe Tep.
Rn := Dis Cnsm in Tep - a result Rn evaluates to true if a condition set Cnsm disappears in a timeframe Tep.
Rn := Ex Cam in Tep - a result Rn evaluates to true if a cause Cam exists in a timeframe Tep.
Rn := Ex Com in Tep - a result Rn evaluates to true if a condition Com exists in a timeframe Tep.
Rn := Ex Cnsm in Tep - a result Rn evaluates to true if a condition set Cnsm exists in a timeframe Tep.

Rn := Ori Dem in Tep - a result Rn evaluates to true if a cause Dem originates in a timeframe Tep.
Rn := Ori Com in Tep - a result Rn evaluates to true if a condition Com originates in a timeframe Tep.
Rn := Ori Cnsm in Tep - a result Rn evaluates to true if a conditions set Cnsm originates in a timeframe Tep.
Rn := Ces Cam in Tep - a result Rn evaluates to true if a cause Cam ceases in a timeframe Tep.
Rn := Ces Com in Tep - a result Rn evaluates to true if a condition Com ceases in a timeframe Tep.
Rn := Ces Cnsm in Tep - a result Rn evaluates to true if a condition set Cnsm ceases in a timeframe Tep.
Rn := H Cam in Tep - a result Rn evaluates to true if a cause Cam holds in a timeframe Tep.
Rn := H Com in Tep - a result Rn evaluates to true if a condition Com holds in a timeframe Tep.
Rn := H Cnsm in Tep - a result Rn evaluates to true if a condition set Cnsm holds in a timeframe Tep.



Links.

See also, if You wish:
* The 'Causal Programming Paradigm'.
* Causal Automated Tests.

Monday, 30 April 2018

Causal Automated Tests.

About.

Automated Unit & Integration tests / pl: zautomatyzowane testy jednostkowe i integracyjne / are not proofs, but these are practical as well - reducing bugfixing costs extremely significiantly at a very small price. There are more benefits to using Automated Tests, for example Mental Harness of Unit & Integration Tests enables one to proceed more boldly, faster, thinking on higher abstraction levels without worryig about minor bugs, relying on tests to handle that. These also can use Invariants.

In the 'Causal Programming Paradigm', each of state changes, as well as methods entrances, having control within, and control leaving can cause conditions appearance, existence, and disappearance event notifications. Methods' leave events contain return values, if applicable.

In the 'Causal Programming Paradigm', causes appearances and disappearances can cause event notifications.

How automated tests are perfomed in this paradigm, then?

1. Test registers for neccessary event notifications,
2. Test runs a method to be tested - which can contain one or many objects/methods.
3. Test gets report of the events raised and analyzes their types, order of appearance and state.
4. Test returns a value - either true or false, which says whether it was success or failure.


Links.

See also, if You wish:
- Invariants,
- Causes & Conditions,
- The 'Causal Programming Paradigm'.

Sunday, 22 April 2018

The 'Causal Programming Paradigm'.

Programming Paradigm is the way of thinking about programming, there are many programming paradigms, both lesser and greater.

Greatest Programming Paradigms are:
- Object Oriented Paradigm,
- Functional Programming Paradigm,
- Programming in Logic.

Programming Languages offer more or less support for programming with paradigms. Java, for example, offers support for Object Oriented & Functional Paradigms. Prolog, for example, offers support for Programming in Logic.

The Object Oriented Paradigm is a great tool for handling large-scale, complex software projects.

The Object Oriented Paradigm was meant to enable people to think about programming in a more abstract way than in the imperative programming, was an attempt to emulate a way of 'how mind works'.

i wish to build on Object Oriented Programming, to make programming even more alike to 'how mind works'.

i wish to create 'Causal Programming Paradigm' / pl: 'paradygmat programowania przyczynowego' /.

... it's both textual and visuospatial method, as one should be able to model objects graph using 3D modelling tools, then fill with code, or just write a code in a purely textual way. Visual Programming can transform to a purely textual code, elegant even - using the automated tools, anyway.

'Ola' Programming Language with its 'Token Game' semantics & nice syntax should enable the 'Causal Programming Paradigm', in a simple, easy, and cost-efficient way. Other important & useful programming paradigms should be supported, as well.

Software created with 'Causal Programming Paradigm' should react to events of causes and conditions appearing, existing and disappearing.

i think it's possible to use 'Causal Programming Paradigm' in the most of modern Programming Languages - at varying costs, however.

Causal Programming Paradigm should keep all of the tools of Object Oriented Paradigm.

i think Causal Modelling, Causal Analysis and Causal Design should also appear with time, as complementaries to Causal Programming Paradigm.


See also, if You wish:
- Causal Analysis: Causes, Results & Correlations,