[メモ]ChatGPTとWolframAlphaで数理経済学

James Werver氏は「日本語の先生から、リスニングとスピーキングの能力が不足していると言われました。頻繁に会話をして友人を困らせたくないので、言語練習用のチャットボットを作ることにしました。」とLinkedInでアプリを紹介している。これは、OpenAI GPT-3.5とWhisper（Speech to Text用）を活用して作られている。しかし、重要な特徴としてWolframAlphaが使われている旨が書かれているので、試したことをメモ。


## 前提知識

- GPT+WolframAlpha+Whisper - a Hugging Face Space by JavaFXpert: https://huggingface.co/spaces/JavaFXpert/Chat-GPT-LangChain
- 大規模言語モデルと外部リソースとを融合させたアプリケーションを作ろう－langchainのご紹介
https://qiita.com/wwwcojp/items/c7f43c5f964b8db8a890

## 実行画面
![Screenshot_2023-02-02_20-21-15.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3124178/0c5693ab-cdb4-6dd2-c0c2-1d227ac45e3b.png)

## 実行例
目的: 経済変数の間の因果関係を網羅させること。

人間
How can we exhaustively define the relationship between consumption, investment, government spending, consumption taxes, etc., through causal inference?

AI
To exhaustively define the relationship between consumption, investment, government spending, consumption taxes, etc., through causal inference, it is necessary to use a combination of quantitative and qualitative methods. Quantitative methods such as regression analysis can be used to identify the relationships between variables, while qualitative methods such as interviews and surveys can be used to gain a deeper understanding of the causal relationships between variables. Additionally, it is important to consider the context in which the variables are operating, as this can have a significant impact on the relationships between them.

人間
However, there are some things that can be modeled intuitively without quantitative analysis. For example, with other conditions fixed, an increase in the consumption tax will decrease consumption.

AI
That is correct. Intuitively, it is easy to understand that an increase in the consumption tax will lead to a decrease in consumption, as consumers will have less disposable income to spend. This is a simple example of how the relationship between two variables can be understood without the need for quantitative analysis.

人間
Now let us write the relationship between X and Y as X(s1)--Y(s2), which can be understood by such an intuitive example. s1 and s2 can be + or -. If consumption decreases when the consumption tax increases, then consumption_tax(+)--consumption(-). list as many economic variables as possible that can be substituted for X and Y.

AI
There are many economic variables that can be substituted for X and Y in the relationship X(s1)--Y(s2). Examples include:

    GDP(+)--Unemployment(-);
    Interest Rates(+)--Investment(-);
    Government Spending(+)--Inflation(-);
    Exchange Rates(+)--Exports(-);
    Tax Rates(+)--Consumer Spending(-).

人間
More examples.

AI
Other examples of economic variables that can be substituted for X and Y in the relationship X(s1)--Y(s2) include:

    Money Supply(+)--Interest Rates(-);
    Government Spending(+)--GDP(-);
    Exchange Rates(+)--Imports(-);
    Tax Rates(+)--Savings(-).

人間
More More examples.

AI
Other examples of economic variables that can be substituted for X and Y in the relationship X(s1)--Y(s2) include:

    Government Debt(+)--Credit Availability(-);
    Interest Rates(+)--Consumer Confidence(-);
    Exchange Rates(+)--Trade Balance(-);
    Tax Rates(+)--Business Investment(-).

人間
More More More examples.

AI
Other examples of economic variables that can be substituted for X and Y in the relationship X(s1)--Y(s2) include:

    Government Regulations(+)--Competition(-);
    Interest Rates(+)--Consumer Spending(-);
    Exchange Rates(+)--Currency Fluctuations(-);
    Tax Rates(+)--Business Profits(-).

人間
More More More More examples.

AI
Other examples of economic variables that can be substituted for X and Y in the relationship X(s1)--Y(s2) include:

    Government Subsidies(+)--Productivity(-);
    Interest Rates(+)--Housing Prices(-);
    Exchange Rates(+)--Capital Flows(-);
    Tax Rates(+)--Consumer Confidence(-).


人間
More More More More More examples.

AI
Other examples of economic variables that can be substituted for X and Y in the relationship X(s1)--Y(s2) include:

    Government Policies(+)--Economic Growth(-);
    Interest Rates(+)--Stock Prices(-);
    Exchange Rates(+)--Balance of Payments(-);
    Tax Rates(+)--Business Expansion(-).

## 参考
- https://sn.linkedin.com/posts/javafxpert_gptwolframalphawhisper-a-hugging-face-activity-7023065629595209728-0P6i

## 補足
この例だとWolframAlphaが効いているかよくわからないが、まあこういう応用があるということで。