Download OpenAPI specification:Download
This service uses the MilkBot fitting engine to fit the MilkBot
model to lactation data. The
returned parameter set can be substituted into the MilkBot
equation
((1 - E^((offset - t)/ramp)/2)*scale)/E^(decay X t)
to generate predicted milk production at any time in the lactation,
where t is time since calving (in days, DIM=0 at calving) and E is Euler's
number.
Simple formulas described at the support URL can calculate
persistence, M305, or cumulative milk between dates. For a fuller description of
the model see Quantifying inter-group variability in lactation curve shape and
magnitude with the MilkBot® lactation model
To use this service, a valid API key must be in a X-API-Key
header of each request.
For a free API Key, contact Jim Ehrlich jehrlich@MilkBot.com
The fitting process uses Bayesian prior expectations as the expected means and standar deviation of
parameter values as well as expected sd of fitting error. If priors are
provided, they will be used. Otherwise default values based on breed and
parity will be used. Use GET /priorsTree
to see default priors.
The PriorsTree uses a discriminator
at each node to value lactations to an appropriate
Priors
.
Options
object may be included with a FittingJob
to control what
data is returned.Fit a single lactation from the supplied array of (DIM, milk weight) data pairs using a default tree of Bayesian priors stratified by on breed and parity.
a single lactation
required | object (Lactation) A single lactation of any length. |
object (Priors) Optional Bayesian prior expectations for use by fitting engine. If not provided, defaults based on breed and parity will be used. means are the expected mean parameter values for the population and sd are expected standard deviation of parameter values for the population seMilk is expected standard error of milk measurements excluding the effects of a normal lactation curve |
{- "lactation": {
- "lacKey": "Bossie123",
- "breed": "J",
- "parity": 1,
- "points": [
- {
- "dim": 33,
- "milk": 21,
- "dayFraction": 0.5
}
]
}, - "priors": {
- "means": {
- "scale": 25.3,
- "ramp": 20,
- "offset": 0,
- "decay": 0.02,
- "milkUnit": {
- "name": "kg"
}
}, - "sd": {
- "scale": 25.3,
- "ramp": 20,
- "offset": 0,
- "decay": 0.02,
- "milkUnit": {
- "name": "kg"
}
}, - "seMilk": 5.2,
- "milkUnit": {
- "name": "kg"
}
}
}
{- "lacKey": "string",
- "fittedParams": {
- "scale": 25.3,
- "ramp": 20,
- "offset": 0,
- "decay": 0.02,
- "milkUnit": {
- "name": "kg"
}
}, - "lactation": {
- "lacKey": "Bossie123",
- "breed": "J",
- "parity": 1,
- "points": [
- {
- "dim": 33,
- "milk": 21,
- "dayFraction": 0.5
}
]
}, - "priors": {
- "means": {
- "scale": 25.3,
- "ramp": 20,
- "offset": 0,
- "decay": 0.02,
- "milkUnit": {
- "name": "kg"
}
}, - "sd": {
- "scale": 25.3,
- "ramp": 20,
- "offset": 0,
- "decay": 0.02,
- "milkUnit": {
- "name": "kg"
}
}, - "seMilk": 5.2,
- "milkUnit": {
- "name": "kg"
}
}, - "seMilk": 0,
- "path": [
- {
- "scale": 25.3,
- "ramp": 20,
- "offset": 0,
- "decay": 0.02,
- "milkUnit": {
- "name": "kg"
}
}
]
}
Fit a group of lactations returning fitted parameter values. If 'priors' are supplied they will be used. Otherwise fitting will be done from defaults.
required | object (FittingJob) A set of lactations to fit with optional priors tree and fit options.. |
{- "fittingJob": {
- "lactationSet": {
- "name": "Example Farm",
- "lactations": [
- {
- "lacKey": "Bossie123",
- "breed": "J",
- "parity": 1,
- "points": [
- {
- "dim": 33,
- "milk": 21,
- "dayFraction": 0.5
}
]
}
], - "milkUnit": {
- "name": "kg"
}
}, - "priorsTree": {
- "_type": "priorsbranch",
- "node": {
- "_type": "priorsleaf",
- "node": {
- "means": {
- "scale": 25.3,
- "ramp": 20,
- "offset": 0,
- "decay": 0.02,
- "milkUnit": {
- "name": "kg"
}
}, - "sd": {
- "scale": 25.3,
- "ramp": 20,
- "offset": 0,
- "decay": 0.02,
- "milkUnit": {
- "name": "kg"
}
}, - "seMilk": 5.2,
- "milkUnit": {
- "name": "kg"
}
}
}
}, - "options": {
- "returnInputData": false,
- "returnPath": false
}
}
}
[- {
- "fits": [
- {
- "lacKey": "string",
- "fittedParams": {
- "scale": 25.3,
- "ramp": 20,
- "offset": 0,
- "decay": 0.02,
- "milkUnit": {
- "name": "kg"
}
}, - "lactation": {
- "lacKey": "Bossie123",
- "breed": "J",
- "parity": 1,
- "points": [
- {
- "dim": 33,
- "milk": 21,
- "dayFraction": 0.5
}
]
}, - "priors": {
- "means": {
- "scale": 25.3,
- "ramp": 20,
- "offset": 0,
- "decay": 0.02,
- "milkUnit": {
- "name": "kg"
}
}, - "sd": {
- "scale": 25.3,
- "ramp": 20,
- "offset": 0,
- "decay": 0.02,
- "milkUnit": {
- "name": "kg"
}
}, - "seMilk": 5.2,
- "milkUnit": {
- "name": "kg"
}
}, - "seMilk": 0,
- "path": [
- {
- "scale": 25.3,
- "ramp": 20,
- "offset": 0,
- "decay": 0.02,
- "milkUnit": {
- "name": "kg"
}
}
]
}
], - "errors": [
- {
- "errorType": "/errors/incorrect-user-pass",
- "title": "incorrect username or password",
- "status": 400,
- "detail": "Authentication failed due to incorrect username or password.",
- "instance": "/login/log/abc123"
}
]
}
]