STAT878: Statistical Computing : Solution Essays

Question:

In this question, you will fit a logistic regression model to estimate each day’s probability of cancellation, using as predictors that day’s temperature and rainfall. Follow the steps below.

(a) Define the model; that is, state the variables, the parameters, and the probabilistic relationship between them.
(b) State the following, in terms of any or all of the response zi , the covariates xi and yi , and the modeled probability pi
(i) the log-likelihood function;
(ii) the gradient of the log-likelihood (the score function);
(iii) the Hessian of the log-likelihood.

 

Answer:

Statistical Computing

Question 1: Maximum Likelihood Estimation

a)Defining the model

The logistic regression is performed using train cancellation data. The response variable cancellation is a dummy variable with 0 representing train cancellation and 1 indicating that the train was cancelled. The day’s temperature and rainfall are the predictor variables used to model the probability of a train being cancelled in a particular day. The model has 3 coefficient parameters which are; beta 0, beta 1 – which is associated with temperature and beta 2 – associated with amount of rain.  These coefficients indicate the amount of change in the response variable for any unit change in the predictor variables. The exponential value of Beta 0 shows that odds of a train being cancelled assuming that rain and temperature were recorded as zero. The exponent value of beta 1 explains the odds of train being cancelled having controlled for rain in the model. In the same manner, exponent value of beta 2 indicates the odds of a train being cancelled in a particular day having controlled for temperature.

b)The modelled Probability pi

i)The log-likelihood function

QUESTION 3: RIDGE REGRESSION (15 marks)

 

Procedure:

(i)Loading the train cancellation information

(ii)The predictor variables are temperature and rainfall, and the response variable is train cancellation

(iii)The predictor variables are plotted against each other.

(iv)The correlation between the predictor variables is obtained with respect to each other. The coefficient estimates for a multilinear model with interaction terms are computed for a range of ridge parameters.

(v) The plots for ridge regression are obtained as shown in the output plots.

% Ridge regression

tc=xlsread(‘TrainCancellation.xlsx’);

temp=tc(:,2);

rainfall=tc(:,3);

cancellation=tc(:,4);

weather=[temp rainfall];

D=x2fx(weather, ‘interaction’)

D(:,1)=[];  %No constant term

k=1:1:365;

b=ridge(cancellation,D,k)

%% plotting the ridge trace

figure(1)

plot(k,b,’LineWidth’,2)

ylim([-100 100])

grid on

xlabel(‘Ridge Parameter’)

ylabel(‘Standardized Coefficient’)

title(‘{bf Ridge Trace}’)

legend(‘Temperature’,’Rainfall’,’Temperature-Rainfall’,’Cancellations’)

 

References

[1] Dobson, A. J., and A. G. Barnett. An Introduction to Generalized Linear Models. Chapman and Hall/CRC. Taylor & Francis Group, 2008.

[2] K. Sigmon and T. A. Davis, MATLAB Primer, Sixth Edition, Chapman and

Hall/CRC, Boca Raton, FL, 2002

[3] Marquardt, D.W. “Generalized Inverses, Ridge Regression, Biased Linear Estimation, and Nonlinear Estimation.” Technometrics. Vol. 12, No. 3, 1970, pp. 591–612.

Place your order
(550 words)

Approximate price: $22

Homework help cost calculator

600 words
We'll send you the complete homework by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 customer support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • 4 hour deadline
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 300 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
× How can I help you?