I was working on linear regression example. I have generated output using Data Analysis tool pack of Excel. Now I want to know how to calculate P value of intercept in linear regression output using formula in excel?
Related
Suppose we have the following linear system:
with the transfer function
and its inverse
.
Using Matlab, I would like to design a discrete, compact filter with minimum delay that represents the inverse transfer function, such that
,
where I use discrete time-index k to denote that the signals are discrete in time.
I am aware of the Matlab function invfreqs and things like filt and filtfilt, but I don't immediately see how to achieve what I am looking for.
The theme here is the use of neural network in learning time histories.
Lets consider for clarity Y = f(X) where X is a vector 1xN and Y 1xN.
In most of the models I can find or test online, X is directly the time vectorised with regular timesteps (X=T).
The prediction task performed on the time history is done therefore using the output Y, and using a sequence of this let say Y(i:i+Nsample) as an Neural Network input and then the output is Y(i+Nsample+1). Then the prediction is performed moving the window one step at the time ( i= i+1).
Now my question is the following. In the case where we have a vector X which is a generic function whose values are known, the problem to model with neural network is:
knowing X(i:i+Nsample+1) and Y(i:i+Nsample) we want to predict Y(i:i+Nsample+1)
then we can do i=i+1 and proceed forward.
What are the best solutions to design such a system, is there an example with Keras or other project from which I could be inspired?
I see several solutions but without being convinced.
a)Set a multidimensional vector (2xNsample) as input [X(i:i+Nsample ) ; Y(i-1:i+Nsample-1)] and predict Y(:i+Nsample) (treat the output as a second input)
b) set two separate lstm for X and Y and then concatenate them in some way
I have 300 data samples with around 4000 dimension feature each. Each input has a 5 dim. output which is in the range of -2 to 2. I am trying to fit a lasso model to it. I went through a few posts which talk about cross validation strategies like this one: Leave one out cross validation algorithm in matlab
But I saw that lasso does not support leaveout in Matlab! http://www.mathworks.com/help/stats/lasso.html
How can I train a model using leave one out cross validation and fit a model using lasso on my dataset? I am trying to do this in matlab. I would like to get a set of weights which I will be able to use for future predictions on other data.
I tried using glmnet: http://www.stanford.edu/~hastie/glmnet_matlab/intro.html but I couldn't compile it on my machine due to lack of proper mex compiler.
Any solutions to my problem? Thanks :)
EDIT
I am also trying to use lasso function in-built with MATLAB. It has an option to perform cross validation. It outputs B and Fit Statistics, where B is Fitted coefficients, a p-by-L matrix, where p is the number of predictors (columns) in X, and L is the number of Lambda values.
Now given a new test sample, how can I calculate the output using this model?
You can use a leave-one-out approach regardless of your training method. As explained here, you can use crossvalind to split the data into training and test sets.
[Train, Test] = crossvalind('LeaveMOut', N, M)
Can anyone explain to me how to generate the Weibull distribution parameters k and c, in Matlab?
I have a file of 8000 data of wind speed, and I'd like to do the following:
Generate the Weibull's k and c parameters of those.
Plot the probability density function against the wind speed.
I am new in Matlab and have not yet been able to do this.
If you have the Statistics toolbox, you can use fitdist:
pd = fitdist(x,'Weibull')
where x is your data. I'm guessing it should return the parameters a and b in:
You can then calculate the pdf (and plot it) using the pdf function. There are some examples (albeit for a normal distribution) in the documentation for fitdist.
I have an ODE model in Matlab coded as a function. I integrate the ODE's over time using ode15s. After the solver has finished, I calculate algebraically, a new variable that's a fraction of the sum of the other variables output by the model.
For example:
dA/dt = xxxxx
dB/dt = xxxxx
dC/dt = xxxxx
this gets integrated and returns an array of columns for dA,dB,dC. From the output I calculate:
model_result = A/(A+B+C).
for the whole time course), and plot this vector of values vs time.
However, I also need to perform sensitivity analysis on the model, for which I've used the modified ODE15s on the Mathworks repository. I need to be able to set "model_result" above as the objective function for the sensitivity calculations.
I attempted to calculate model_result inside the function, and have it returned as another variable, but obviously this doesn't work as the integrator returns the integrated value, rather than the algebraically calculated value.
Is it possible to have algebraic values returned by an ODE solver in Matlab?
If not, does anybody have any idea how to perform this kind of sensitivity analysis?
thanks for any help. I'm quite new to modelling so apologies if I'm using all the wrong terms!