<p>Attached image. How would you find the relationship between independent variable (x) and dependent variable (y)? Is it linear or non-linear? What would the function looks like?</p>
<p>P.S. I believe this is a non-linear regression problem as we are trying to fit a model (function) to this data. I just can't figure out the function. It seems like a mix of positive and negative sigmoid? or quadratic?</p>
<p><a href="https://i.sstatic.net/sYmVz.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/sYmVz.png" alt="Updated plot" /></a></p>
<p>Here is my code I am trying to recreate the plot I saw before:</p>
<p>import pandas as pd</p>
<p>#create DataFrame
df = pd.DataFrame({'x': [0, 1, 2, 3, 11, 12.2, 12.4, 13.9, 14, 15, 4, 10.7, 12.6, 8, 8.5, 9, 13.5, 13.1, 12.8, 5, 15, 14.5, 6, 6.3, 6.6, 7, 7.4, 5.4, 4.4, 3.5, 2.5, 1.5, 0.5],
'y': [0, 3, 7, 8, 25, 40, 15, 105, -10, -20, 12, 60, 80, 37, 40, 46, 100, 66, 5, 16, 120, 28, 22, 24, 26, 30, 32, 18.5, 14.3, 9.8, 8, 5.2, 1.8]})</p>
<p>#view DataFrame
print(df)</p>
<p>import matplotlib.pyplot as plt</p>
<p>#create scatterplot
plt.scatter(df.x, df.y)
plt.ylabel('Dependent Variable')
plt.xlabel('Independent Variable')
plt.title('Function?')
plt.show()</p>

CC BY-SA 4.0
2024-02-14T10:56:04.330Z
This does not look like a function. For the same x, it seems the function may produce different $y$s. So, there might be some stochasticity here, or it's just the plot that suggests that it.
nbro
CC BY-SA 4.0
2024-02-14T13:53:17.983Z
@nbro Sorry that is my bad. I drew this plot based on what I remember from the similar plot I saw before. There should not be multiple y values per x, so imagine this is a 1 on 1 function. How would you approach this then? what type of activation function does this look like? It must be one from the famous DL activation function family, e.g. logistic, ploynomial, sigmoid, etc. https://en.wikipedia.org/wiki/Activation_function
DLCVIP007
CC BY-SA 4.0
2024-02-14T14:29:59.187Z
It would be great if you removed the wrong dots then.
nbro
CC BY-SA 4.0
2024-02-14T14:54:55.983Z
@nbro I just did. To the best of my knowledge. All I remember is the +120 and -20 on Y axis. and data looked non linear. almost exponential. data was really concentrated up until x=4, then started spreading up and down .
DLCVIP007
CC BY-SA 4.0
2024-02-14T16:07:28.900Z
Reminds me of this sort of graph: https://graphicmaths.com/img/fractals/fractals/bifurcation/bifurcation-4.png implying you have a system with behaviour phasing between linear and non-linear behaviour, becoming chaotic. If that's the case, accuracy of predictions for x > 4 will necessarily be inaccurate, because precise prediction is impossible
Neil Slater
CC BY-SA 4.0
2024-02-15T14:54:55.387Z
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
vl_knd
<machine-learning><regression><sigmoid><non-linear-regression>
Find the relationship between data in this plot
DLCVIP007
# Find the relationship between data in this plot

(Asked by: username_0 on 2024-02-14)

Attached image. How would you find the relationship between independent variable (x) and dependent variable (y)? Is it linear or non-linear? What would the function looks like?

P.S. I believe this is a non-linear regression problem as we are trying to fit a model (function) to this data. I just can't figure out the function. It seems like a mix of positive and negative sigmoid? or quadratic?

[![Updated plot](https://i.sstatic.net/sYmVz.png)](https://i.sstatic.net/sYmVz.png)

Here is my code I am trying to recreate the plot I saw before:

import pandas as pd

#create DataFrame
df = pd.DataFrame({'x': [0, 1, 2, 3, 11, 12.2, 12.4, 13.9, 14, 15, 4, 10.7, 12.6, 8, 8.5, 9, 13.5, 13.1, 12.8, 5, 15, 14.5, 6, 6.3, 6.6, 7, 7.4, 5.4, 4.4, 3.5, 2.5, 1.5, 0.5],
'y': [0, 3, 7, 8, 25, 40, 15, 105, -10, -20, 12, 60, 80, 37, 40, 46, 100, 66, 5, 16, 120, 28, 22, 24, 26, 30, 32, 18.5, 14.3, 9.8, 8, 5.2, 1.8]})

#view DataFrame
print(df)

import matplotlib.pyplot as plt

#create scatterplot
plt.scatter(df.x, df.y)
plt.ylabel('Dependent Variable')
plt.xlabel('Independent Variable')
plt.title('Function?')
plt.show()

**Tags:** machine-learning, regression, sigmoid, non-linear-regression

> **Comments:**
> **username_1**: This does not look like a function. For the same x, it seems the function may produce different $y$s. So, there might be some stochasticity here, or it's just the plot that suggests that it.  
> **username_0**: @username_1 Sorry that is my bad. I drew this plot based on what I remember from the similar plot I saw before. There should not be multiple y values per x, so imagine this is a 1 on 1 function. How would you approach this then? what type of activation function does this look like? It must be one from the famous DL activation function family, e.g. logistic, ploynomial, sigmoid, etc. https://en.wikipedia.org/wiki/Activation_function  
> **username_1**: It would be great if you removed the wrong dots then.  
> **username_0**: @username_1 I just did. To the best of my knowledge. All I remember is the +120 and -20 on Y axis. and data looked non linear. almost exponential. data was really concentrated up until x=4, then started spreading up and down .  
> **username_2**: Reminds me of this sort of graph: https://graphicmaths.com/img/fractals/fractals/bifurcation/bifurcation-4.png implying you have a system with behaviour phasing between linear and non-linear behaviour, becoming chaotic. If that's the case, accuracy of predictions for x > 4 will necessarily be inaccurate, because precise prediction is impossible  
> **username_3**: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.  

---

## 0 answers

