R: Understanding formulas -
i'm trying better understanding of r formulas mathematically mean.
for example: lm(y ~ x)
fit line y = ax + b
would lm(y ~ x + z)
fitting plane y = ax + bz + c
? lm(y ~ x + z + x:z)
fitting plane y = ax + bz + cxz + d
?
your understanding correct! though may helpful understand bit more abstractly. linear model (lm) means it's fitting parameters on one-dimensional dependance (ax not ax^2 or asin(x) or fancier that).
but not mean fits 1 3 parameters. imagine foods represent dimensions: grains, fruits, vegetables, meats, , dairy make our 5 "dimensions of food". these things relatable--and maybe not independent--but still not totally describable in same ways. can think of our model tool gauges our coefficients--which in food example can imagine "flavors", sweet, spicy, sour, etc.
our model takes points in different dimensions (food groups) , attempts relate them coefficient values (flavors) function. model allows describe other foods/flavors. models "do": "train" on annotated data , build relationship--linear models treat flavors directly proportional amount of food group.
i hope explanation helpful. if there's that's unclear, please let me know. also, have made comment have not yet accumulated required 50 pts. sorry!
Comments
Post a Comment