Skip to content

math formulas are not interpreting visually in Copilot Chat, showing in katex or latex format #255243

@ededovic

Description

@ededovic

When I ask a question of Copilot Chat:
write the below as math formula

  # Negative log-likelihood for normal distribution
  nll = -np.sum(-0.5*np.log(2*np.pi*sigma**2) - (y-predicted_y)**2 / (2*sigma**2))

This is the response I get in the vs code:

[ nll = -\sum_{i=1}^{n} \left[ -\frac{1}{2}\log(2\pi\sigma^2) - \frac{(y_i-\hat{y_i})^2}{2\sigma^2} \right] ]

Where:

( n ) is the number of observations.
( \log ) denotes the natural logarithm.
( \pi ) represents the mathematical constant pi.
( \sigma ) is the standard deviation.
( y_i ) represents the actual value for the i-th observation.
( \hat{y_i} ) represents the predicted value for the i-th observation.
The sum is over all ( i ) from 1 to ( n ).

I would be ok with this, notice it is missing i in the \sum as well as some other niceties (I converted the above into notebook markdown by replacing [ ] and ( ) with $ $) :

formula-Screenshot 2024-02-28 211332

Version: 1.87.0 (user setup)
Commit: 019f4d1
Date: 2024-02-27T23:41:44.469Z
Electron: 27.3.2
ElectronBuildId: 26836302
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Windows_NT x64 10.0.22631

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions