Speeding up this function?

Is there a way to speed this function?

``````SpeedthisUpPlease({(Beta)_, (Delta)_, (Theta)_, (Rho)_,
aPar_, (Gamma)_, (Eta)_}) :=
Block({L1, L2, K11, K12, K22, S1, S2, S3, S4, S5, S6, MatPi, W, U,
Cmat, CmatStar},

L1 = ((Eta) - (Beta)*(1 - (Delta)))/((Beta)*(Eta)*(Theta)^2);
L2 = (Rho)*((Eta) - (Beta)*(1 - (Delta)))/((Eta) - (Beta)*(1
- (Theta))*(1 - (Delta)));
K11 = ((Eta) - (Beta)*(1 - (Theta))*(1 - (Delta)))/((Beta)*
(Eta)*(Theta));
K12 = ((Beta)*(Eta)*(Theta)^2 - (Eta) + (Beta)*(1 -
(Theta)^2)*(1 - (Delta)))/((Beta)*(Eta)*(Theta)^2);
K22 = (Eta)*(Theta)/((Eta) - (Beta)*(1 - (Theta))*(1 -
(Delta)));
S1 = (K22 - K11)/K12;
S2 = ((K22 - K11)*L1 - K12*L2)/(K12*(K11 - (Rho)));
S3 = K22;
S4 = K12*
L2/(K22 -
K11) + ((K22 - (Rho))*((K22 - K11)*L1 - K12*L2))/((K22 -
K11)*(K11 - (Rho)));
S5 = {1 - (1 - (Theta))/(Theta)*S1,
S1 + ((Eta)/(Beta) -
1 + (Delta))/((Theta)^2*((Eta) -
1 + (Delta)))*((Theta) - S1), 1 - 1/(Theta)*S1};
S6 = {1/(Theta) - (1 - (Theta))/(Theta)*S2,
S2 + ((Eta)/(Beta) -
1 + (Delta))/((Theta)^2*((Eta) - 1 + (Delta)))*(1 - S2),
1/(Theta) - 1/(Theta)*S2};

U = Transpose({Flatten({S5, S1}), Flatten({S6, S2})});
MatPi = {{S3, S4}, {0, (Rho)}};
(*W={{0},{1}};*)

aPar^(1/(1 - (Theta)))*((Theta)/((Eta)/(Beta) -
1 + (Delta)))^((Theta)/(1 - (Theta)))*(1 - (Theta))/
(Gamma)*(1 - (Theta)*((Eta) - 1 + (Delta))/((Eta)/(Beta) -
1 + (Delta)))^-1;

csteady = (1 - (Theta)*((Eta) - 1 + (Delta))/((Eta)/(Beta) -

hstead = (1 - (Theta))/(Gamma)*(1 - (Theta)*((Eta) -
1 + (Delta))/((Eta)/(Beta) - 1 + (Delta)))^-1;

Cmat = Drop(U, {2});

{MatPi, Cmat, CmatStar}
)
``````

The input must be a list of 7 real numbers, most of them will be between 0 and 1, but not all.
Below is an example of a possible input.

``````vec = RandomVariate(UniformDistribution(1), 7) // Flatten
``````

The output of `SpeedthisUpPlease(vec)` is the following:

``````{{{0.531418, 0.931421}, {0, 0.454912}}, {{0.325754,
1.14853}, {-0.132494, 0.249482}, {0.458248,
0.899051}}, {{-0.623107}, {0.0943832}, {-0.547928}}}
``````

MatPi is the 2 by 2 matrix `{{0.531418, 0.931421}, {0, 0.454912}}`.

Cmat is the 3 by 2 matrix `{{0.325754, 1.14853}, {-0.132494, 0.249482}, {0.458248, 0.899051}}`,

CmatStar is the 3 by 1 matrix `{{-0.623107}, {0.0943832}, {-0.547928}}`.

Regarding an explanation about the function itself, it’s the solution of a state-space model, whose formula has been derived by hand. The input are the parameters of this state-space model.