Calculate a linear regression

Hello everyone,

I hope everybody is doing well in this specific time!
I am quite new to Dynamo, this topic is here to help me starting with a new script and to take the good way to do it.
The problem is quite simple : i would like to calculate an offset value and build it around curves. My reference data gives me a certain list of curves radius values and offset values associated. My design data would be a list of effective curves radius values not necessarily matching the reference values.
What i would like to do then is to calculate for each design curves the offset value to be associated as a linear regression of the two framing reference values. How would you do this?

Some screenshots below :

Hi,

I found one solution using geometry i share it with you. If anyone as any other idea i am interrested.