1
$\begingroup$

I want to be able to predict the optical density of a radiograph (x-ray image) based on the input factors of depth, SID, KVP, MAS. I'm a lot more familiar with linear models and have never had to give a model an equation before, and frankly, I have no idea what the equation should be.

I've used the equation below and the model is successful and does fit well (to an extent) with the experimental data, so it does what I need to do. However, I want to choose an equation the 'proper' way however that might be as I want to present my research academically. I can find little to no guidance on this however online.

sa1<-nls(OD~ ((KVP^a)*(MAS^b))/((SID^c)*(e*DEPTH^d)),
         data=bathdata,
         start=c(a=0, b=0, c=0, d=0.1, e=0.1))

For reference OD increases> exponentially with increasing MAS

exponentially with increasing KVP

AND

OD decreases> exponentially with increasing SID exponentially with increasing depth

[I'm an undergrad student trying to model OD as part of a project to optimise images and thus reduce radiation dose to bariatric patients]

Thank you for any responses

$\endgroup$

2 Answers 2

1
$\begingroup$

If your understanding of the subject matter supports those "exponential" associations of your predictors with OD, then that seems to be an appropriate form of equation to start with.

Note that if you take the logs of both sides, you can convert this into a linear regression model using the logs of the current variable values:

log(OD) = a*log(KPV) + b*log(MAS) - c*log(SID) - e - d*log(DEPTH)

Thus you could model with lm() in R:

lm(log(OD) ~  log(KPV) + log(MAS) + log(SID) + log(DEPTH))

The coefficients (including the intercept) will all be related to those in your non-linear model. Technically, you are now modeling the mean of log(OD) values, not the mean of the OD values as you are in the non-linear model, but it might do what you need. This might be appropriate if errors around model predictions are relatively constant in magnitude on the log(OD) scale.

Alternatively, you could consider a Gaussian generalized linear model with a log link for the outcome OD and the log-transformed predictors, in R:

glm(OD ~ log(KPV) + log(MAS) + log(SID)+ log(DEPTH), family=gaussian(link="log"))

That models the log of the mean OD as a function of the log-transformed predictors. The glm could be more appropriate if error magnitudes are relatively constant in the OD scale, which is the assumption you are implicitly making in your non-linear model.

Either approach in the log scale will probably have less danger of numerical difficulties than will trying to solve the original non-linear equation with lots of exponents.

$\endgroup$
0
$\begingroup$

However, I want to choose an equation the 'proper' way however that might be as I want to present my research academically.

That is commendable.

In my opinion, the "'proper' way", i.e., the most rigorous way works similar to a mathematical proof. You start with what you 'know' about the process that generated your data and derive a model of that process. This often results in a differential equation that can be solved for specific boundary and starting conditions. If you need examples for that approach, look into thermodynamics, e.g., see this Wikipedia entry.

Sometimes you can rely on analogies and don't need to do all that work. Fick's laws of diffusion were derived by positing an analogy with heat transfer. You can apply the solutions of differential equations describing heat transfer to diffusion problems.

If you don't know enough to derive a model for the data-generating process your model will always be at least partly empirical. Still, you might be able to convincingly derive at least some basic properties of the functional relationship from scientific knowledge or analogies (e.g., you might know that the relationship has to be convex, or maybe that there is saturation, or maybe that observed dependent values must be positive, or ...). Good examples of this apporach are some models for sorption isotherms.

If you can't do that, you could fit a non-parametric model and either use that or select non-linear functions that often occur as solutions of the rigorous approach (e.g. the exponential function, the log function or trigonometric functions) based on the shape of the non-parametric fit (or just based on plots of the data).

Finally, a linear model can be a surprisingly good approximation over a limited range of data. If you don't need to extrapolate, such a linear model might be sufficient even if the true relationship is non-linear.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.