SOLUTION: Let's directly calculate the 95% confidence intervals of our parameters. The formula for a given parameter is:
πΆπΌ=(π½βπ§β
π πβ―β―β,π½+π§β
π πβ―β
Algebra.Com
Question 1135297: Let's directly calculate the 95% confidence intervals of our parameters. The formula for a given parameter is:
πΆπΌ=(π½βπ§β
π πβ―β―β,π½+π§β
π πβ―β―β)
Where, π½ is the coefficient, π§ is the critical value(t-statistic required to obtain a probability less than the alpha significance level), and ππΈπ,π is the Standard Error Matrix.
start = '2014-01-01'
end = '2015-01-01'
asset = get_pricing('KO', fields='price', start_date=start, end_date=end)
benchmark = get_pricing('PEP', fields='price', start_date=start, end_date=end)
X = asset.pct_change()[1:]
Y = benchmark.pct_change()[1:]
result = sm.OLS(Y,X).fit()
# Convert X to Matrix (adding columns of one)
X = np.vstack((X, np.ones( X.size ) ))
X = np.matrix( X )
# Matrix Multiplication and inverse calculation
C = np.linalg.inv( X * X.T )
C *= result.mse_resid
SE = np.sqrt(C) # Calucaltion of Standart Error.
# Critical Values of the t-statistic
N = result.nobs
P = result.df_model
dof = N - P - 1
z = scipy.stats.t(dof).ppf(0.975)
i = 0
## Your code goes here
# Fetch values of Beta and parameters of SE from the matrix
beta = ## Your code goes here
c = ## Your code goes here
print ## Your code goes here
## Instead of running the code above and calculate the CI step by step,
## you can get the CI automatically from OLS table.
Answer by ikleyn(53937) (Show Source): You can put this solution on YOUR website!
.
Nonsense.
Not an appropriate post/problem/request for this forum.
Do not spend your time for nothing posting such requests - they make no sense.
Have a nice day / afternoon / evening / night / morning etc.
RELATED QUESTIONS
Please help me with statistics homework question.
Which statement is NOT true about... (answered by MathLover1)
for a given confidence interval, what is the interpretation of a 96% confidence level?
(answered by stanbon)
Could someone help me with the lower and upper, I have everything else and can't seem to... (answered by Boreal)
Finding confidence intervals.
Find the margin of error and the confidence interval for... (answered by Boreal)
You are given the sample mean and the population standard deviation. Use this information (answered by Theo)
You are given the sample mean and the population standard deviation. Use this information (answered by math_tutor2020)
Stuck on p value. Thanks for help!
Is there a relationship between confidence intervals (answered by Boreal)
nEED HELP WITH LOWER, UPPER AND P VALUE
Is there a relationship between confidence... (answered by Boreal)
Hello, I am trying to solve this problem for confidence intervals with the five step... (answered by lynnlo)