Optimisation Problem: Given some data calculate the correct value

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have a real world problem that I would like to solve. I think this problem is an optimisation one. But I am not sure, and I have never work with optimisation algorithms or formulas.



I have 8 records of data:



  • Start Date

  • End Date

  • Monday, Tuesday ... Sunday Values in milligrams

  • Y

So a single record is a range of dates that a patient took some medicine. The patient takes every day his medicine as indicated by the data above (3rd point).



For example,



  • 01/08/2018

  • 15/08/2018

  • Monday: 4.5 milligram, Tuesday: 4.5 milligram, Wednesday: 5.0 milligram .... Sunday: 5.5 milligram.

  • 2.46

Given the above data, start date, end date, milligram per day, this yields to the value of Y.



I would like to calculate the milligram per day given a start, end dates and desired Y value.



Although programmatically I was able to represent the problem and also to calculate the total medicine in milligram given the range of dates etc, I am struggling on how to form a formula to solve the problem.



So given the following data:



  • 01/08/2018

  • 15/08/2018

  • 2.46

I should get:



  • Monday: 4.5 milligram, Tuesday: 4.5 milligram, Wednesday: 5.0 milligram .... Sunday: 5.5 milligram.

Y is a value that is observed by doing blood test and observe a specific variable. Y can have a range of 1.1 to 4.0 I would say. The Y is affected based on the medicine taken by the patient in total (i.e total milligram within the date range, not really concerned about how much is taken each day).



Is this possible?



Thank you!







share|cite|improve this question






















  • Do you have any requirements that would not be satisfied simply by looking up in the table you already have?
    – Henning Makholm
    Aug 15 at 12:52










  • I am not sure. Because this is really a real world problem and not an exercise, I have a friend who takes a medicine this way and he is trying to get a desired Y value. I trust that the table should give always similar or close to similar results. It is an organism after all. With all that said, mathematically I don't think I have any requirements that would not be satisfied simply by looking up the table.
    – John
    Aug 15 at 12:55










  • I'm not asking simply out of an abstract desire to make things mathematically neat. But you have not explained what $Y$ even means -- so for all we know the only way to distinguish a good answer from a bad one is to ask what your table states for your given input.
    – Henning Makholm
    Aug 15 at 13:02






  • 1




    What is the time stamp of the $Y$ value compare to the date range? Are you measuring $Y$ at the end? Also, is the desired $Y$ value inside the range of $Y$ values in your data, or is it outside? Offhand, I would say this looks like a standard interpolation problem. You don't have a lot of data, though, so your accuracy might be suspect.
    – Adrian Keister
    Aug 15 at 13:05










  • Sorry for not making this clear. Y is a value that is observed by doing blood test and observe a specific variable, I just use Y here. Y can have a range of 1.1 to 4.0 I would say
    – John
    Aug 15 at 13:06















up vote
0
down vote

favorite












I have a real world problem that I would like to solve. I think this problem is an optimisation one. But I am not sure, and I have never work with optimisation algorithms or formulas.



I have 8 records of data:



  • Start Date

  • End Date

  • Monday, Tuesday ... Sunday Values in milligrams

  • Y

So a single record is a range of dates that a patient took some medicine. The patient takes every day his medicine as indicated by the data above (3rd point).



For example,



  • 01/08/2018

  • 15/08/2018

  • Monday: 4.5 milligram, Tuesday: 4.5 milligram, Wednesday: 5.0 milligram .... Sunday: 5.5 milligram.

  • 2.46

Given the above data, start date, end date, milligram per day, this yields to the value of Y.



I would like to calculate the milligram per day given a start, end dates and desired Y value.



Although programmatically I was able to represent the problem and also to calculate the total medicine in milligram given the range of dates etc, I am struggling on how to form a formula to solve the problem.



So given the following data:



  • 01/08/2018

  • 15/08/2018

  • 2.46

I should get:



  • Monday: 4.5 milligram, Tuesday: 4.5 milligram, Wednesday: 5.0 milligram .... Sunday: 5.5 milligram.

Y is a value that is observed by doing blood test and observe a specific variable. Y can have a range of 1.1 to 4.0 I would say. The Y is affected based on the medicine taken by the patient in total (i.e total milligram within the date range, not really concerned about how much is taken each day).



Is this possible?



Thank you!







share|cite|improve this question






















  • Do you have any requirements that would not be satisfied simply by looking up in the table you already have?
    – Henning Makholm
    Aug 15 at 12:52










  • I am not sure. Because this is really a real world problem and not an exercise, I have a friend who takes a medicine this way and he is trying to get a desired Y value. I trust that the table should give always similar or close to similar results. It is an organism after all. With all that said, mathematically I don't think I have any requirements that would not be satisfied simply by looking up the table.
    – John
    Aug 15 at 12:55










  • I'm not asking simply out of an abstract desire to make things mathematically neat. But you have not explained what $Y$ even means -- so for all we know the only way to distinguish a good answer from a bad one is to ask what your table states for your given input.
    – Henning Makholm
    Aug 15 at 13:02






  • 1




    What is the time stamp of the $Y$ value compare to the date range? Are you measuring $Y$ at the end? Also, is the desired $Y$ value inside the range of $Y$ values in your data, or is it outside? Offhand, I would say this looks like a standard interpolation problem. You don't have a lot of data, though, so your accuracy might be suspect.
    – Adrian Keister
    Aug 15 at 13:05










  • Sorry for not making this clear. Y is a value that is observed by doing blood test and observe a specific variable, I just use Y here. Y can have a range of 1.1 to 4.0 I would say
    – John
    Aug 15 at 13:06













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have a real world problem that I would like to solve. I think this problem is an optimisation one. But I am not sure, and I have never work with optimisation algorithms or formulas.



I have 8 records of data:



  • Start Date

  • End Date

  • Monday, Tuesday ... Sunday Values in milligrams

  • Y

So a single record is a range of dates that a patient took some medicine. The patient takes every day his medicine as indicated by the data above (3rd point).



For example,



  • 01/08/2018

  • 15/08/2018

  • Monday: 4.5 milligram, Tuesday: 4.5 milligram, Wednesday: 5.0 milligram .... Sunday: 5.5 milligram.

  • 2.46

Given the above data, start date, end date, milligram per day, this yields to the value of Y.



I would like to calculate the milligram per day given a start, end dates and desired Y value.



Although programmatically I was able to represent the problem and also to calculate the total medicine in milligram given the range of dates etc, I am struggling on how to form a formula to solve the problem.



So given the following data:



  • 01/08/2018

  • 15/08/2018

  • 2.46

I should get:



  • Monday: 4.5 milligram, Tuesday: 4.5 milligram, Wednesday: 5.0 milligram .... Sunday: 5.5 milligram.

Y is a value that is observed by doing blood test and observe a specific variable. Y can have a range of 1.1 to 4.0 I would say. The Y is affected based on the medicine taken by the patient in total (i.e total milligram within the date range, not really concerned about how much is taken each day).



Is this possible?



Thank you!







share|cite|improve this question














I have a real world problem that I would like to solve. I think this problem is an optimisation one. But I am not sure, and I have never work with optimisation algorithms or formulas.



I have 8 records of data:



  • Start Date

  • End Date

  • Monday, Tuesday ... Sunday Values in milligrams

  • Y

So a single record is a range of dates that a patient took some medicine. The patient takes every day his medicine as indicated by the data above (3rd point).



For example,



  • 01/08/2018

  • 15/08/2018

  • Monday: 4.5 milligram, Tuesday: 4.5 milligram, Wednesday: 5.0 milligram .... Sunday: 5.5 milligram.

  • 2.46

Given the above data, start date, end date, milligram per day, this yields to the value of Y.



I would like to calculate the milligram per day given a start, end dates and desired Y value.



Although programmatically I was able to represent the problem and also to calculate the total medicine in milligram given the range of dates etc, I am struggling on how to form a formula to solve the problem.



So given the following data:



  • 01/08/2018

  • 15/08/2018

  • 2.46

I should get:



  • Monday: 4.5 milligram, Tuesday: 4.5 milligram, Wednesday: 5.0 milligram .... Sunday: 5.5 milligram.

Y is a value that is observed by doing blood test and observe a specific variable. Y can have a range of 1.1 to 4.0 I would say. The Y is affected based on the medicine taken by the patient in total (i.e total milligram within the date range, not really concerned about how much is taken each day).



Is this possible?



Thank you!









share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Aug 15 at 13:13

























asked Aug 15 at 12:46









John

1041




1041











  • Do you have any requirements that would not be satisfied simply by looking up in the table you already have?
    – Henning Makholm
    Aug 15 at 12:52










  • I am not sure. Because this is really a real world problem and not an exercise, I have a friend who takes a medicine this way and he is trying to get a desired Y value. I trust that the table should give always similar or close to similar results. It is an organism after all. With all that said, mathematically I don't think I have any requirements that would not be satisfied simply by looking up the table.
    – John
    Aug 15 at 12:55










  • I'm not asking simply out of an abstract desire to make things mathematically neat. But you have not explained what $Y$ even means -- so for all we know the only way to distinguish a good answer from a bad one is to ask what your table states for your given input.
    – Henning Makholm
    Aug 15 at 13:02






  • 1




    What is the time stamp of the $Y$ value compare to the date range? Are you measuring $Y$ at the end? Also, is the desired $Y$ value inside the range of $Y$ values in your data, or is it outside? Offhand, I would say this looks like a standard interpolation problem. You don't have a lot of data, though, so your accuracy might be suspect.
    – Adrian Keister
    Aug 15 at 13:05










  • Sorry for not making this clear. Y is a value that is observed by doing blood test and observe a specific variable, I just use Y here. Y can have a range of 1.1 to 4.0 I would say
    – John
    Aug 15 at 13:06

















  • Do you have any requirements that would not be satisfied simply by looking up in the table you already have?
    – Henning Makholm
    Aug 15 at 12:52










  • I am not sure. Because this is really a real world problem and not an exercise, I have a friend who takes a medicine this way and he is trying to get a desired Y value. I trust that the table should give always similar or close to similar results. It is an organism after all. With all that said, mathematically I don't think I have any requirements that would not be satisfied simply by looking up the table.
    – John
    Aug 15 at 12:55










  • I'm not asking simply out of an abstract desire to make things mathematically neat. But you have not explained what $Y$ even means -- so for all we know the only way to distinguish a good answer from a bad one is to ask what your table states for your given input.
    – Henning Makholm
    Aug 15 at 13:02






  • 1




    What is the time stamp of the $Y$ value compare to the date range? Are you measuring $Y$ at the end? Also, is the desired $Y$ value inside the range of $Y$ values in your data, or is it outside? Offhand, I would say this looks like a standard interpolation problem. You don't have a lot of data, though, so your accuracy might be suspect.
    – Adrian Keister
    Aug 15 at 13:05










  • Sorry for not making this clear. Y is a value that is observed by doing blood test and observe a specific variable, I just use Y here. Y can have a range of 1.1 to 4.0 I would say
    – John
    Aug 15 at 13:06
















Do you have any requirements that would not be satisfied simply by looking up in the table you already have?
– Henning Makholm
Aug 15 at 12:52




Do you have any requirements that would not be satisfied simply by looking up in the table you already have?
– Henning Makholm
Aug 15 at 12:52












I am not sure. Because this is really a real world problem and not an exercise, I have a friend who takes a medicine this way and he is trying to get a desired Y value. I trust that the table should give always similar or close to similar results. It is an organism after all. With all that said, mathematically I don't think I have any requirements that would not be satisfied simply by looking up the table.
– John
Aug 15 at 12:55




I am not sure. Because this is really a real world problem and not an exercise, I have a friend who takes a medicine this way and he is trying to get a desired Y value. I trust that the table should give always similar or close to similar results. It is an organism after all. With all that said, mathematically I don't think I have any requirements that would not be satisfied simply by looking up the table.
– John
Aug 15 at 12:55












I'm not asking simply out of an abstract desire to make things mathematically neat. But you have not explained what $Y$ even means -- so for all we know the only way to distinguish a good answer from a bad one is to ask what your table states for your given input.
– Henning Makholm
Aug 15 at 13:02




I'm not asking simply out of an abstract desire to make things mathematically neat. But you have not explained what $Y$ even means -- so for all we know the only way to distinguish a good answer from a bad one is to ask what your table states for your given input.
– Henning Makholm
Aug 15 at 13:02




1




1




What is the time stamp of the $Y$ value compare to the date range? Are you measuring $Y$ at the end? Also, is the desired $Y$ value inside the range of $Y$ values in your data, or is it outside? Offhand, I would say this looks like a standard interpolation problem. You don't have a lot of data, though, so your accuracy might be suspect.
– Adrian Keister
Aug 15 at 13:05




What is the time stamp of the $Y$ value compare to the date range? Are you measuring $Y$ at the end? Also, is the desired $Y$ value inside the range of $Y$ values in your data, or is it outside? Offhand, I would say this looks like a standard interpolation problem. You don't have a lot of data, though, so your accuracy might be suspect.
– Adrian Keister
Aug 15 at 13:05












Sorry for not making this clear. Y is a value that is observed by doing blood test and observe a specific variable, I just use Y here. Y can have a range of 1.1 to 4.0 I would say
– John
Aug 15 at 13:06





Sorry for not making this clear. Y is a value that is observed by doing blood test and observe a specific variable, I just use Y here. Y can have a range of 1.1 to 4.0 I would say
– John
Aug 15 at 13:06
















active

oldest

votes











Your Answer




StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "69"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2883557%2foptimisation-problem-given-some-data-calculate-the-correct-value%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2883557%2foptimisation-problem-given-some-data-calculate-the-correct-value%23new-answer', 'question_page');

);

Post as a guest













































































這個網誌中的熱門文章

How to combine Bézier curves to a surface?

Propositional logic and tautologies

Distribution of Stopped Wiener Process with Stochastic Volatility