2
votes

I have a dataset from a biological experiment:

x = c(0.488, 0.977, 1.953, 3.906, 7.812, 15.625, 31.250, 62.500, 125.000, 250.000, 500.000, 1000.000)
y = c(0.933, 1.036, 1.112, 1.627, 2.646, 5.366, 11.115, 2.355, 1.266, 0, 0, 0)

plot(log(x),y)

x represents a concentration and y represents the response in our assay.

The plot can be found here: 1

How can I predict the x-value (concentration) of a pre-defined y-value (in my case 1.5)?

After a loess smoothing I can predict the y-value at a defined x-value. See the example:

smooth_data <- loess(y~log(x))
predict(smooth_data, 1.07) # which gives 1.5

Using the predict function, both x = 1.07 and x = 5.185 result in y = 1.5

Is there a convenient way to get the estimates from the loess regression at y = 1.5 without manually typing some x values into the predict function?

Any suggestions?

2

2 Answers

0
votes

I gues your x and y's are pairs? so for f(0.488) = 0.933 and so on?

More of a mathproblem in my opinion :).

If you could define a function that describes your graph it would be pretty easy.

You could also draw a straight line between all points and for every line that intersects with your y value you could get corrosponding x values. But straight lines wouldn't be really precies.

If you have enough pairs you could also train a neureal network. That might get you the best results but takes some time and alot of pairs to train well.

Could you clarify your question a bit and tell us what you are looking for? A way to do it or a code example?

I hope this is helping you atleast a little bit :)

0
votes

Since your function is not monotonic, there is no true inverse, but if you split it into two functions - one for x < maximum and one for x > maximum - you can just create two inverse functions and solve for whatever values of y you want.

smooth_data <- loess(y~log(x))

X = seq(0,6.9,0.1)
P = predict(smooth_data, X)
M = which.max(P)

Inverse1 = approxfun(X[1:M] ~ P[1:M])
Inverse2 = approxfun(X[M:length(X)] ~ P[M:length(X)])

Inverse1(1.5)
[1] 1.068267
predict(smooth_data, 1.068267)
[1] 1.498854
Inverse2(1.5)
[1] 5.185876
predict(smooth_data, 5.185876)
[1] 1.499585