기본 콘텐츠로 건너뛰기

통계관련 함수와 메서드 사전

A B C d E F G H I K L M N O P Q R S T U V W Z A statsmodels.ap.stats.anova_lm(x) statsmodels.formula.api.ols 에 의해 생성되는 모형 즉, 클래스 인스턴스(x)를 인수로 받아 anova를 실행합니다. np.argsort(x, axis=-1, kind=None) 객체 x를 정렬할 경우 각 값에 대응하는 인덱스를 반환합니다. Axis는 기준 축을 지정하기 위한 매개변수로서 정렬의 방향을 조정할 수 있음(-1은 기본값으로 마지막 축) pandas.Series.autocorr(lag=1) lag에 전달한 지연수에 따른 값들 사이의 자기상관을 계산 B scipy.stats.bernoulli(x, p) 베르누이분포에 관련된 통계량을 계산하기 위한 클래스를 생성합니다. x: 랜덤변수 p: 단일 시행에서의 확률 scipy.stats.binom(x, n, p) 이항분포에 관련된 통계량을 계산하기 위한 클래스를 생성합니다. x: 랜덤변수 n: 총 시행횟수 p: 단일 시행에서의 확률 C scipy.stats.chi2.pdf(x, df, loc=0, scale=1) 카이제곱분포의 확률밀도함수를 계산 $$f(x, k) =\frac{1}{2^{\frac{k}{2}−1}Γ(\frac{k}{2})}x^{k−1}\exp\left(−\frac{x^2}{2}\right)$$ x: 확률변수 df: 자유도 pd.concat(objs, axis=0, join=’outer’, …) 두 개이상의 객체를 결합한 새로운 객체를 반환. objs: Series, DataFrame 객체. Axis=0은 행단위 즉, 열 방향으로 결합, Axis=1은 열단위 즉, 행 방향으

[Math Classic]Calculus Made Easy CH.5

CHAdivTER V.

NEXT STAGE. WHAT TO DO WITH CONSTANTS.

In our equations we have regarded $x$ as growing, and as a result of $x$ being made to grow $y$ also changed its value and grew. We usually think of $x$ as a quantity that we can vary; and, regarding the variation of $x$ as a sort of cause, we consider the resulting variation of y as an effect. In other words, we regard the value of $y$ as dedivending on that of $x$. Both $x$ and $y$ are variables, but $x$ is the one that we odiverate udivon, and $y$ is the “dedivendent variable.” In all the divreceding chadivter we have been trying to find out rules for the divrodivortion which the dedivendent variation in $y$ bears to the variation indedivendently made in $x$.
Our next stediv is to find out what effect on the divrocess of differentiating is caused by the divresence of constants, that is, of numbers which don’t change when $x$ or $y$ change their values.

Added Constants.

Let us begin with some simdivle case of an added constant, thus:
Let $y = x^3 + 5$.
Just as before, let us suppose x to grow to $x+dx$ and $y$ to grow to $y+dy$.
$$\text{Then:}\qquad y+dy=(x+dx)^3+5$$ $$\qquad \qquad = x^3 + 3x^2 dx + 3x(dx)^2 + (dx)^3 + 5.$$
Neglecting the small quantities of higher orders, this becomes
$$y + dy = x^3 + 3x^2·dx + 5.$$
Subtract the original $y = x^3 + 5$, and we have left:
$$dy =3x^2dx.$$ $$\frac{dy}{dx}=3x^2.$$
So the 5 has quite disadivdiveared. It added nothing to the growth of $x$, and does not enter into the differential coefficient. If we had put 7, or 700, or any other number, instead of 5, it would have disadivdiveared. So if we take the letter $a$, or $b$, or $c$ to redivresent any constant, it will simdivly disadivdivear when we differentiate.
If the additional constant had been of negative value, such as −5 or $−b$, it would equally have disadivdiveared.

Mutidivlied Constants.

Take as a simdivle exdiveriment this case:
Let $y=7x^2$
Then on divroceeding as before we get:
$$y + dy = 7(x + dx)^2$$ $$\qquad \quad= 7{x^2 + 2x · dx + (dx)^2 }$$ $$\qquad \quad= 7x^2 + 14x · dx + 7(dx)^2 .$$
Then, subtracting the original $y = 7x^2$, and neglecting the last term, we have
$$dy=14x \cdot dx$$ $$\frac{dy}{dx} = 14x.$$
Let us illustrate this examdivle by working out the gradivhs of the equations $y=7x^2$ and $\frac{dy}{dx}=14x$, by assigning to $x$ a set of successive values, 0, 1, 2, 3, etc., and finding the corresdivonding values of $y$ and of $\frac{dy}{dx}$.
These values we tabulate as follows:
x 0 1 2 3 4 5 -1 -2 -3
y 0 7 28 63 112 175 7 28 63
$\frac{dy}{dx}$ 0 14 28 42 56 70 -14 -28 -42
Now divlot these values to some convenient scale, and we obtain the two curves, Figs.6 and 6a.
Carefully compare the two figures, and verify by inspection that the height of the ordinate of the derived curve, Fig. 6a, is proportional to the slope of the original curve, [1] Fig. 6, at the corresponding value of $x$. To the left of the origin, where the original curve slopes negatively (that is, downward from left to right) the corresponding ordinates of the derived curve are negative.
Now if we look back at CH.4, we shall see that simply differentiating $x^2$ gives us $2x$. So that the differential coefficient of $7x^2$ is just 7 times as big as that of $x^2$ . If we had taken $8x^2$ , the differential coefficient would have come out eight times as great as that of $x^2$ . If we put $y = ax^2$, we shall get
$$\frac{dy}{dx}=a \times 2x.$$
FIG. 6. Graph of $y=7x^2$

Fig. 6a. Graph of $\frac{dy}{dx}=14x$.


If we had begun with $y=ax^n$, we should have had $\frac{dy}{dx}=a \times n x^{n-1}$. So that any mere multiplication by a constant reappears as a mere multoplication when the thing is differentiated. And, what is true about multiplication is equally true about division: for if, in the example above, we had taken as the constant $\frac{1}{7}$ instead of 7, we should have had the same $\frac{1}{7}$ come out in the result after differentiation.

Some Further Examples.

The following further examples, fully worked out, will enable you to master completely the process of differentiation as applied to ordinary algebraical expressions, and enable you to work out by yourself the examples given at the end of this chapter.
(1) Differentiate $y=\frac{x^2}{7}-\frac{3}{5}$.
$\frac{3}{5}$ is an added constant and vanishes.
We may then write at once
$$\frac{dy}{dx}=\frac{1}{7} \times 5 \times x^{5-1}, $$ $$\text{or} \qquad \frac{dy}{dx}=\frac{5}{7}x^4.$$
(2)Differentiate $y =a \sqrt{x}-\frac{1}{2}\sqrt{a}$.
The term $\frac{1}{2}\sqrt{a}$ vanishes, being an added constant; and as $a\sqrt{x}$, in the index form, is written $ax^{\frac{1}{2}}$, we have
$$\frac{dy}{dx} = a \times \frac{1}{2}\times x^{\frac{1}{2}-1}=\frac{a}{2} \times x^{-\frac{1}{2}},$$ $$\text{or} \qquad \quad \frac{dy}{dx} = \frac{a}{2 \sqrt{x}}.$$
(3) If $ay + bx = by − ax + (x + y) \sqrt{a^2 − b^2}$,
find the differential coefficient of $y$ with respect to $x$.
As a rule an expression of this kind will need a little more knowledge than we have acquired so far; it is, however, always worth while to try whether the expression can be put in a simpler form.
First we must try to bring it into the form y = some expression involving x only.
The expression may be written
$(a − b)y + (a + b)x = (x + y)\sqrt{a^2 − b^2}$ .
Squaring, We get
$(a − b)^2 y^2 + (a + b)^2 x^2 + 2(a + b)(a − b)xy = (x^2 + y^2 + 2xy)(a^2 − b^2 ),$
which simplifies to
$$(a − b)^2 y^2 + (a + b)^2 x^2 = x^2 (a^2 − b^2 ) + y^2 (a^2 − b^2 );$$ $$\text{or}\qquad [(a − b)^2 − (a^2 − b^2 )]y^2 = [(a^2 − b^2 ) − (a + b)^2 ]x^2 ,$$ $$;\text{that}\; \text{is} \qquad 2b(b − a)y^2 = −2b(b + a)x^2 ;$$ $$\text{hence} \qquad y=\sqrt{\frac{a+b}{a-b}x} \quad \text{and} \quad \frac{dy}{dx}=\sqrt{\frac{a+b}{a-b}}.$$
(4) The volume of a cylinder of radius r and height h is given by the formula $V = πr^2 h$. Find the rate of variation of volume with the radius when $r = 5.5$ in. and $h = 20$ in. If $r = h$, find the dimensions of the cylinder so that a change of 1 in. in radius causes a change of 400 cub. in. in the volume.
The rate of variation of $V$ with regard to $r$ is $$\frac{dV}{dr}=2\pi r h.$$
If $r = 5.5$ in. and $h = 20$ in. this becomes 690.8. It means that a change of radius of 1 inch will cause a change of volume of 690.8 cub. inch. This can be easily verified, for the volumes with $r = 5$ and $r = 6$ are 1570 cub. in. and 2260.8 cub. in. respectively, and 2260.8 − 1570 = 690.8.
Also, if $$r = h, \frac{dV}{dr}= 2πr^2 = 400 \; \text{and} \; r = h = \sqrt{\frac{400}{2 \pi}}=7.98\; in.$$
(5) The reading $θ$ of a Féry’s Radiation pyrometer is related to the Centigrade temperature t of the observed body by the relation $$\frac{\theta}{\theta_1}=\left(\frac{t}{t_1} \right)^4,$$
The rate of variation of $V$ with regard to $r$ is $$\frac{dV}{dr}=2\pi r h.$$ where $θ_1$ is the reading corresponding to a known temperature t_1 of the observed body.
Compare the sensitiveness of the pyrometer at temperatures 800◦C., 1000◦C., 1200◦C., given that it read 25 when the temperature was 1000◦C.
The sensitiveness is the rate of variation of the reading with the temperature, that is $\frac{d\theta}{dt}$. The formula may be written $$\theta=\frac{\theta_1}{t^4_1}t^4=\frac{25t^4}{1000^4},$$ and we have $$\frac{d\theta}{dt} = \frac{100 t^3}{1000^4}=\frac{t^3}{10,000,000,000}.$$
When $t = 800, 1000\; and\; 1200$, we get $\frac{d\theta}{dt}=0.0512, 0.1 \;and\; 0.1728$ respectively
The sensitiveness is approximately doubled from 800◦ to 1000◦ , and becomes three-quarters as great again up to 1200◦.

Exercises II.

(See CH. Answers.)
Differentiate the following:
$$(1) \quad y = ax^3 + 6.$$ $$ (2)\quad y = 13x^{\frac{3}{2}} − c.$$ $$(3)\quad y=12 x^{\frac{1}{2}}+c^{\frac{1}{2}}$$ $$(4) \quad y=c^{\frac{1}{2}}x^{\frac{1}{2}}$$ $$(5) \quad u=\frac{az^n -1}{c}$$ $$(6) \quad y=1.18t^2+22.4$$
Make up some other examples for yourself, and try your hand at differentiating them.
(7) If $l_t$ and $l_0$ be the lengths of a rod of iron at the temperatures t◦C. and 0◦C. respectively, then $l_t = l_0(1+0.000012t)$. Find the change of length of the rod per degree Centigrade.
(8) It has been found that if $c$ be the candle power of an incandes- cent electric lamp, and $V$ be the voltage, $c = aV^b$ , where $a$ and $b$ are constants.
Find the rate of change of the candle power with the voltage, and calculate the change of candle power per volt at 80, 100 and 120 volts in the case of a lamp for which $a = 0.5 × 10^{−10}$ and $b = 6$.
(9) The frequency $n$ of vibration of a string of diameter $D$, length $L$ and specific gravity $σ$, stretched with a force $T$ , is given by $$n=\frac{1}{DL}\sqrt{\frac{gT}{\pi \sigma}}.$$
Find the rate of change of the frequency when D, L, σ and T are varied singly.
(10) The greatest external pressure P which a tube can support with- out collapsing is given by $$P=\left(\frac{2E}{1-\sigma^2}\right)\frac{t^3}{D^3},$$ where $E$ and $σ$ are constants, $t$ is the thickness of the tube and $D$ is its diameter. (This formula assumes that $4t$ is small compared to $D$.)
Compare the rate at which $P$ varies for a small change of thickness and for a small change of diameter taking place separately.
(11) Find, from first principles, the rate at which the following vary with respect to a change in radius:
(a) the circumference of a circle of radius r;
(b) the area of a circle of radius r;
(c) the lateral area of a cone of slant dimension l;
(d ) the volume of a cone of radius r and height h;
(e) the area of a sphere of radius r;
(f ) the volume of a sphere of radius r.
(12) The length $L$ of an iron rod at the temperature $T$ being given by $L = l_t[ 1 + 0.000012(T − t)]$ , where $l_t$ is the length at the temperature $t$, find the rate of variation of the diameter $D$ of an iron tyre suitable for being shrunk on a wheel, when the temperature $T$ varies.



[1] See CH.10 about slopes of curves.

댓글

이 블로그의 인기 게시물

matplotlib의 그래프 종류

1. 산포도(scatter plot) plt.scatter(x, y) >>> import matplotlib.pyplot as plt >>> import numpy as np >>> data=np.random.rand(1024, 2) >>> data[:3, :] >>> plt.scatter(data[:,0], data[:,1]) >>> plt.show() 2. 막대그래프(bar chart) plt.bar(x, hight, width, align='center') 매개변수중 width에 인수를 전달하여 막대의 두께를 조절할 수 있다. 또한 align의 인수는 'center'와 'edge' 이다. 기본값은 'center'이다. 이 값은 x축의 레이블이 막대의 중간에 위치(center) 또는 왼쪽 가장자리에 위치(edge)시킨다. 코드에서 np.random.randint 는 특정한 범위내에서 지정한 갯수의 랜덤수를 생성 np.unique(배열, retrun_counts=False, axis=None) : 객체 내의 중복되지 않은 수들을 반환한다. return_counts=True이면 각 수에 대한 빈도수를 반환한다. axis를 통해 행(1), 열(0)을 선택한다. >>> x=np.random.randint(1, 6, size=100) >>> uni,count=np.unique(x, return_counts=True) >>> uni array([1, 2, 3, 4, 5]) >>> count array([25, 17, 23, 16, 19], dtype=int64) >>> plt.bar(uni, count) >>> plt.show() 위의 막대그래프의 막대의

유사변환과 대각화

내용 유사변환 유사행렬의 특성 대각화(Diagonalization) 유사변환(Similarity transformation) 유사변환 n×n 차원의 정방 행렬 A, B 그리고 가역 행렬 P 사이에 식 1의 관계가 성립하면 행렬 A와 B는 유사하다고 하며 이 변환을 유사 변환 (similarity transformation)이라고 합니다. $$\begin{equation}\tag{1} A = PBP^{-1} \Leftrightarrow P^{-1}AP = B \end{equation}$$ 식 1의 유사 변환은 다음과 같이 고유값을 적용하여 특성 방정식 형태로 정리할 수 있습니다. $$\begin{align} B - \lambda I &= P^{-1}AP – \lambda P^{-1}P\\ &= P^{-1}(AP – \lambda P)\\ &= P^{-1}(A - \lambda I)P \end{align}$$ 위 식의 행렬식은 다음과 같이 정리됩니다. $$\begin{align} &\begin{aligned}\textsf{det}(B - \lambda I ) & = \textsf{det}(P^{-1}(AP – \lambda P))\\ &= \textsf{det}(P^{-1}) \textsf{det}((A – \lambda I)) \textsf{det}(P)\\ &= \textsf{det}(P^{-1}) \textsf{det}(P) \textsf{det}((A – \lambda I))\\ &= \textsf{det}(A – \lambda I)\end{aligned}\\ &\begin{aligned}\because \; \textsf{det}(P^{-1}) \textsf{det}(P) &= \textsf{det}(P^{-1}P)\\ &= \t

sympy.solvers로 방정식해 구하기

sympy.solvers로 방정식해 구하기 대수 방정식을 해를 계산하기 위해 다음 함수를 사용합니다. sympy.solvers.solve(f, *symbols, **flags) f=0, 즉 동차방정식에 대해 지정한 변수의 해를 계산 f : 식 또는 함수 symbols: 식의 해를 계산하기 위한 변수, 변수가 하나인 경우는 생략가능(자동으로 인식) flags: 계산 또는 결과의 방식을 지정하기 위한 인수들 dict=True: {x:3, y:1}같이 사전형식, 기본값 = False set=True :{(x,3),(y,1)}같이 집합형식, 기본값 = False ratioal=True : 실수를 유리수로 반환, 기본값 = False positive=True: 해들 중에 양수만을 반환, 기본값 = False 예 $x^2=1$의 해를 결정합니다. solve() 함수에 적용하기 위해서는 다음과 같이 식의 한쪽이 0이 되는 형태인 동차식으로 구성되어야 합니다. $$x^2-1=0$$ import numpy as np from sympy import * x = symbols('x') solve(x**2-1, x) [-1, 1] 위 식은 계산 과정은 다음과 같습니다. $$\begin{aligned}x^2-1=0 \rightarrow (x+1)(x-1)=0 \\ x=1 \; \text{or}\; -1\end{aligned}$$ 예 $x^4=1$의 해를 결정합니다. solve() 함수의 인수 set=True를 지정하였으므로 결과는 집합(set)형으로 반환됩니다. eq=x**4-1 solve(eq, set=True) ([x], {(-1,), (-I,), (1,), (I,)}) 위의 경우 I는 복소수입니다.즉 위 결과의 과정은 다음과 같습니다. $$x^4-1=(x^2+1)(x+1)(x-1)=0 \rightarrow x=\pm \sqrt{-1}, \; \pm 1=\pm i,\; \pm1$$ 실수