Skip to content

Commit

Permalink
update parameter estimation and monte carlo
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Oct 26, 2017
1 parent b4da20d commit a6568ee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
10 changes: 7 additions & 3 deletions docs/src/analysis/parameter_estimation.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,18 @@ is a function which reduces the problem's solution. While this is very
flexible, a two convenience routines is included for fitting to data:

```julia
L2DistLoss(t,data)
CostVData(t,data;loss_func = L2DistLoss)
L2DistLoss(t,data;weight=nothing)
CostVData(t,data;loss_func = L2DistLoss,weight=nothing)
```

where `t` is the set of timepoints which the data is found at, and
`data` which are the values that are known. `L2DistLoss` is an optimized version
of the L2-distance. In `CostVData`, one can choose any loss function from
LossFunctions.jl or use the default of an L2 loss.
LossFunctions.jl or use the default of an L2 loss. The `weight` is a vector
of weights for the loss function which must match the size of the data.

Note that minimization of a weighted `L2DistLoss` is equivalent to maximum
likelihood estimation of a heteroskedastic Normally distributed likelihood.

#### Note About Loss Functions

Expand Down
10 changes: 4 additions & 6 deletions docs/src/features/monte_carlo.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ One can specify a function `prob_func` which changes the problem. For example:

```julia
function prob_func(prob,i,repeat)
prob.u0 = randn()*prob.u0
@. prob.u0 = randn()*prob.u0
prob
end
```
Expand All @@ -45,7 +45,7 @@ you can have the `i`th simulation use the `i`th initial condition via:

```julia
function prob_func(prob,i,repeat)
prob.u0 = u0_arr[i]
@. prob.u0 = u0_arr[i]
prob
end
```
Expand Down Expand Up @@ -279,8 +279,7 @@ and use that for calculating the trajectory:

```julia
function prob_func(prob,i,repeat)
prob.u0 = rand()*prob.u0
prob
ODEProblem(prob.f,rand()*prob.u0,prob.tspan)
end
```

Expand Down Expand Up @@ -422,8 +421,7 @@ Our `prob_func` will simply randomize the initial condition:
prob = ODEProblem((t,u)->1.01u,0.5,(0.0,1.0))

function prob_func(prob,i,repeat)
prob.u0 = rand()*prob.u0
prob
ODEProblem(prob.f,rand()*prob.u0,prob.tspan)
end
```

Expand Down

0 comments on commit a6568ee

Please sign in to comment.