Assume you’re using GPT-4.

MathPix Account & Install ChatGPT Equations

MathPix (limited free monthly usage): Most powerful PDF OCR to accurately lift content out as nicely formatted text and math formula as KaTeX.

‣: Install this Chrome extension to make math notation script KaTeX copy-able from ChatGPT’s response

Sample Prompts to enter into ChatGPT-4

  1. Suppose we want to process a trading performance evaluation method called Tail Ratio from a pdf paper:

    performance.pdf

  2. Upload the pdf to Snip.MathPix.com portal, select the page(s) where the Tail Ratio is described.

  3. In the Snip.MathPix.com portal, use mouse to select the region in the pdf page where the text and mathematically expressed formulas you want to be OCR-ed and copied to your clipboard.

  4. The LaTeX formatted plaintext will become available for you to copied to your clipboard.

  5. Use the prompting structure below to prompt ChatGPT-4.

  6. Note that the brown-coloured text within the triple quotes (''') are OCR-ed and copied from pdf papers using MathPix. Bold black-coloured text are templated prompt.

**Analyse the following content within the triple quotes:

'''**

An important question for the investor is whether a manager’s extreme returns tend to be larger on the upside or the downside. Managers with frequent small gains and occasional large losses (negatively skewed managers) are more risky and less desirable than managers with frequent small losses and occasional large gains (positively skewed managers). Although there is a statistic that measures skewness - the degree to which a return distribution has longer tails (extreme events) on the right (positive) or left (negative) side than the symmetric normal distribution-it is difficult to attach intuitive meaning to specific values (beyond the value of the sign).

The tail ratio measures the tendency for extreme returns to be skewed to the positive or negative side in a statistic whose value is intuitively clear.

$$
T R=\\frac{\\frac{\\sum_{p=0}^{p=T} X_{p}}{N_{p<T}}}{\\left|\\frac{\\sum_{p=100-T}^{p=100} X_{p}}{N_{p>100-T}}\\right|}
$$

where $X_{p}=$ return at percentile $p$

$T=$ threshold percentile to calculate numerator of tail ratio (Implicit assumption: Lower percentile rankings represent higher return. For example, the top $10 \\%$ of returns would be all returns less than $T$, where $T=10$.)

$N_{p<T}=$ number of returns below percentile

$N_{p>100-T}=$ number of returns above percentile $100-T$

The tail ratio requires one parameter input: the upper and lower percentile threshold used to calculate the statistic. If the threshold is set to 10 , for example, the tail ratio would be equal to the average of all returns in the top decile of returns divided by the absolute value of the average of all returns in the bottom decile of returns. (Note: If the average of bottom decile returns is positive, the tail ratio would have no meaning and cannot be calculated.) If returns were normally distributed, the tail ratio would equal 1.0. A ratio significantly less than 1.0 would indicate a tendency for the largest losses to be of greater magnitude than the largest gains, while a ratio significantly greater than 1.0 would indicate the reverse tendency. For example, if the tail ratio was equal to 0.5 , it would imply that the magnitude of the average loss in the bottom decile was twice as large as the average gain in the top decile-a reading indicative of a potentially very risky manager.

'''

**Contextually name the concept, and re-name all participatory descriptors and assisting descriptors in the triple quoted descriptions so that they are more adherent to computer science conventions.
Eliminate all unnecessary descriptors that do not participate the narratives or outputs.
Formalize all the aforementioned dynamically processed framework, purposes, meanings, parameters, suggested values, characteristics, workflow and their associated logics in stringent logical, and mathematical expressions.
Show me a few examples to show your understanding of the concept.
Share some other concepts that has some characteristics of the concept.

From now on, whenever you need to write a mathematical expression, use KaTeX notation and follow these rules:
1. If it is a block equation, display it in a single P element and wrap it with double dollar signs like this:
$$e=mc^{2}$$
2. If it is an inline equation, use the two backslash and parenthesis notation of KaTeX, like this: \\(e^{i \\pi}-1=0\\).**
  1. Next, if the response looks fine and reasonably structured, ask ChatGPT-4 to build it in Python.
**Write a Python function with corresponding main guard to capture the full scope and characteristics of what you've understood so far.
All the required input parameters and their suggested values, if any proposed, are used as default.**

Sample Dialogue with ChatGPT-4

ChatGPT

Afterword

Using ChatGPT plugins that can handle PDF files, such as ChatWithGPT, provides a smoother user experience. However, since they cannot interpret mathematical notations as accurately as MathPix, they often result in errors in interpretation.

Untitled