# Maximum Likelihood: Normal Linear Model

**URL:** <https://discourse.julialang.org/t/maximum-likelihood-normal-linear-model/11664>\
**Category:** Optimization (Mathematical)\
**Created:** [June 13, 2018, 9:40pm UTC](https://discourse.julialang.org/t/maximum-likelihood-normal-linear-model/11664 "2018-06-13T21:40:24Z")\
**Posts on this page:** 12\
**Page:** 2

<div class="post-metadata">

**Author:** ![Donald\_Lacombe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/donald_lacombe/32/13500_2.png) [@Donald\_Lacombe](https://discourse.julialang.org/u/Donald_Lacombe)\
**Post date:** [June 19, 2018, 7:42pm UTC](https://discourse.julialang.org/t/maximum-likelihood-normal-linear-model/11664/21 "2018-06-19T19:42:16Z")

</div>

I have looked at the Literate package as you and `@pkofod` mentioned and have produced a tutorial but since I cannot send any files via the Discourse forum I would appreciate some guidance. I need another pair (or two) of eyes to check my Jupyter notebook and Markdown file (which was very easy to create, BTW).

Thank You!

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [June 20, 2018, 5:49am UTC](https://discourse.julialang.org/t/maximum-likelihood-normal-linear-model/11664/22 "2018-06-20T05:49:14Z")

</div>

> [@Donald\_Lacombe](#):
>
> I cannot send any files via the Discourse forum

Perhaps put them in a [gist](https://gist.github.com/)?

---

<div class="post-metadata">

**Author:** ![anriseth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/anriseth/32/3106_2.png) [@anriseth](https://discourse.julialang.org/u/anriseth)\
**Post date:** [June 20, 2018, 2:20pm UTC](https://discourse.julialang.org/t/maximum-likelihood-normal-linear-model/11664/23 "2018-06-20T14:20:18Z")

</div>

That was quick 🙂 I’ll see if I can enable the Literate examples in the Optim.jl documentation today or tomorrow, and then you can submit your example as a PR to Optim.

Uploading the Literate file as a gist, as @Tamas_Papp suggested is also a good way to show us the tutorial.

---

<div class="post-metadata">

**Author:** ![Donald\_Lacombe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/donald_lacombe/32/13500_2.png) [@Donald\_Lacombe](https://discourse.julialang.org/u/Donald_Lacombe)\
**Post date:** [June 20, 2018, 7:25pm UTC](https://discourse.julialang.org/t/maximum-likelihood-normal-linear-model/11664/24 "2018-06-20T19:25:47Z")

</div>

I have added both the markdown file and the Jupyter notebook as a gist, as Thomas Papp suggested. The copied URL is as follows:

[https://gist.github.com/djlacombe/6c4ec789833514713df1d61f091cd89b.js](https://gist.github.com/djlacombe/6c4ec789833514713df1d61f091cd89b.js)

The name of the gist in both cases is “Maximum Likelihood Estimation in Julia: The Normal Linear Model”.

I tried to add a TIP to the markdown but it is not rendering correctly and I’m happy to make any corrections that anyone can point out in terms of errors or clarifications.

As for the speed of the work, I’ve been given the fortune to discover this community and Julia and just wish to provide something in return.

Thanks!

---

<div class="post-metadata">

**Author:** ![tyleransom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tyleransom/32/530_2.png) [@tyleransom](https://discourse.julialang.org/u/tyleransom)\
**Post date:** [June 21, 2018, 4:49pm UTC](https://discourse.julialang.org/t/maximum-likelihood-normal-linear-model/11664/25 "2018-06-21T16:49:25Z")

</div>

Thanks for putting this together; this morning it helped me figure out how to do a similar problem.

---

<div class="post-metadata">

**Author:** ![anriseth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/anriseth/32/3106_2.png) [@anriseth](https://discourse.julialang.org/u/anriseth)\
**Post date:** [June 21, 2018, 4:59pm UTC](https://discourse.julialang.org/t/maximum-likelihood-normal-linear-model/11664/26 "2018-06-21T16:59:33Z")

</div>

Great 🙂

If you wish, I can add your tutorial to the Literate [PR I made to Optim just now](https://github.com/JuliaNLSolvers/Optim.jl/pull/632), but then I would need a gist of the original `jl` file and not the Markdown or ipynb files.

Alternatively, you can follow the steps I did there and submit a PR yourself if you would like to do that instead (but then I advise waiting for my PR to be merged) 😉

> [@Donald\_Lacombe](#):
>
> I tried to add a TIP to the markdown but it is not rendering correctly and I’m happy to make any corrections that anyone can point out in terms of errors or clarifications.

The Markdown TIP is written in a way so that it will work when the documentation is deployed (after it has been merged to the `master` branch on Optim. But that is all taken care of automatically so you can just copy-paste what I did in my example (you’ll have to change the file names, however 😛 )

---

<div class="post-metadata">

**Author:** ![Donald\_Lacombe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/donald_lacombe/32/13500_2.png) [@Donald\_Lacombe](https://discourse.julialang.org/u/Donald_Lacombe)\
**Post date:** [June 21, 2018, 6:51pm UTC](https://discourse.julialang.org/t/maximum-likelihood-normal-linear-model/11664/27 "2018-06-21T18:51:38Z")

</div>

Excellent! That’s what I was hoping for in putting this together.

I’ll probably add some more tutorials in the near future.

---

<div class="post-metadata">

**Author:** ![Donald\_Lacombe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/donald_lacombe/32/13500_2.png) [@Donald\_Lacombe](https://discourse.julialang.org/u/Donald_Lacombe)\
**Post date:** [June 21, 2018, 6:54pm UTC](https://discourse.julialang.org/t/maximum-likelihood-normal-linear-model/11664/28 "2018-06-21T18:54:34Z")

</div>

I’ve placed a public `gist` on the board at the following location:

[https://gist.github.com/djlacombe/b13b4386b20106f5933985d71c0f8073.js](https://gist.github.com/djlacombe/b13b4386b20106f5933985d71c0f8073.js)

As you can see, it’s a Julia script and I’m happy for you to do the PR…

I’ll need to learn more about GitHub and PR’s. For some reason PR’s make me nervous and I don’t want to be “that guy” who completely destroyed the Julia ecosystem with one mouse click.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [June 22, 2018, 5:30am UTC](https://discourse.julialang.org/t/maximum-likelihood-normal-linear-model/11664/29 "2018-06-22T05:30:04Z")

</div>

> [@Donald\_Lacombe](#):
>
> I don’t want to be “that guy” who completely destroyed the Julia ecosystem with one mouse click.

You can’t. With a version control system you can always backtrack, and in any case PRs are like suggestions, to be reviewed by the repo maintainers. It is OK to make git mistakes too, you can always correct them.

---

<div class="post-metadata">

**Author:** ![pkofod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pkofod/32/2179_2.png) [@pkofod](https://discourse.julialang.org/u/pkofod)\
**Post date:** [June 22, 2018, 9:32am UTC](https://discourse.julialang.org/t/maximum-likelihood-normal-linear-model/11664/30 "2018-06-22T09:32:40Z")

</div>

Yup! Don’t be afraid. It’s really not that hard, and we’ll be happy to help you if some stages are not clear.

---

<div class="post-metadata">

**Author:** ![Donald\_Lacombe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/donald_lacombe/32/13500_2.png) [@Donald\_Lacombe](https://discourse.julialang.org/u/Donald_Lacombe)\
**Post date:** [December 7, 2020, 4:19am UTC](https://discourse.julialang.org/t/maximum-likelihood-normal-linear-model/11664/31 "2020-12-07T04:19:49Z")

</div>

I’m revisiting this issue and had a quick question that I hope someone can answer.

The `fieldnames(fun2)` doesn’t return the elements of the `fun2` structure anymore.

Is there an alternative that I can use? I’d like to be able to recover some of these parameters.

Thank you for any help in advance.

---

<div class="post-metadata">

**Author:** ![gabrielgellner](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gabrielgellner/32/75_2.png) [@gabrielgellner](https://discourse.julialang.org/u/gabrielgellner)\
**Post date:** [December 25, 2020, 2:14am UTC](https://discourse.julialang.org/t/maximum-likelihood-normal-linear-model/11664/32 "2020-12-25T02:14:34Z")

</div>

you need to do `fieldnames(typeof(fun2))` now.

[Previous page](https://discourse.julialang.org/t/maximum-likelihood-normal-linear-model/11664.md?page=1)
