Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "MANIPULATE";
- NString[v_] := ToString[ScientificForm[v], TraditionalForm];
- CIValue[f_, c_, n_, v_] := f @@ Transpose[c][[n]] /. x -> v;
- FitMean[f_, c_, v_] := NString[N[CIValue[f, c, 2, v]]];
- FitStatistic[f_, c_, v_] :=
- NString[N[CIValue[f, c, 2, v]]] <> "(+" <>
- NString[N[CIValue[f, c, 3, v] - CIValue[f, c, 2, v]]] <> ")(-" <>
- NString[N[CIValue[f, c, 2, v] - CIValue[f, c, 1, v]]] <> ")";
- FitInterval[f_, c_, v_] :=
- NString[{N[CIValue[f, c, 1, v]], N[CIValue[f, c, 2, v]],
- N[CIValue[f, c, 3, v]]}];
- Manipulate[
- FitComparePlot[profitBeforeTaxFit["Linear"], linear,
- profitBeforeTaxCI["Linear", confidenceLevel], 0,
- endYear + Length[profitBeforeTaxData] - 1],
- Style["PROFIT BEFORE TAX LINEAR FIT PLOT", Bold,
- Medium], {{endYear, 5, "Forecast Distance"}, 0, 10, 1,
- Appearance -> "Labeled"}, {{confidenceLevel, 70,
- "Confidence Level"}, 50, 99, 1, Appearance -> "Labeled"},
- SaveDefinitions -> True]
- Manipulate[
- "R^2 Value: " <>
- ToString[N[profitBeforeTaxFit["Linear"]["RSquared"]]] <> "\n" <>
- "Mean: " <>
- FitMean[linear, profitBeforeTaxCI["Linear", confidenceLevel],
- endYear + Length[profitBeforeTaxData] - 1] <> "\n" <>
- "Statistic: " <>
- FitStatistic[linear, profitBeforeTaxCI["Linear", confidenceLevel],
- endYear + Length[profitBeforeTaxData] - 1] <> "\n" <>
- "Interval: " <>
- FitInterval[linear, profitBeforeTaxCI["Linear", confidenceLevel],
- endYear + Length[profitBeforeTaxData] - 1],
- Style["PROFIT BEFORE TAX LINEAR FIT INFO", Bold,
- Medium], {{endYear, 5, "Forecast Distance"}, 0, 10, 1,
- Appearance -> "Labeled"}, {{confidenceLevel, 70,
- "Confidence Level"}, 50, 99, 1, Appearance -> "Labeled"},
- SaveDefinitions -> True]
- Manipulate[
- FitComparePlot[profitBeforeTaxFit["Exponential"], exponential,
- profitBeforeTaxCI["Exponential", confidenceLevel], 0,
- endYear + Length[profitBeforeTaxData] - 1],
- Style["PROFIT BEFORE TAX EXPONENTIAL FIT PLOT", Bold,
- Medium], {{endYear, 5, "Forecast Distance"}, 0, 10, 1,
- Appearance -> "Labeled"}, {{confidenceLevel, 70,
- "Confidence Level"}, 50, 99, 1, Appearance -> "Labeled"},
- SaveDefinitions -> True]
- Manipulate[
- "R^2 Value: " <>
- ToString[N[profitBeforeTaxFit["Exponential"]["RSquared"]]] <> "\n" <>
- "Mean: " <>
- FitMean[exponential,
- profitBeforeTaxCI["Exponential", confidenceLevel],
- endYear + Length[profitBeforeTaxData] - 1] <> "\n" <>
- "Statistic: " <>
- FitStatistic[exponential,
- profitBeforeTaxCI["Exponential", confidenceLevel],
- endYear + Length[profitBeforeTaxData] - 1] <> "\n" <>
- "Interval: " <>
- FitInterval[exponential,
- profitBeforeTaxCI["Exponential", confidenceLevel],
- endYear + Length[profitBeforeTaxData] - 1],
- Style["PROFIT BEFORE TAX EXPONENTIAL FIT INFO", Bold,
- Medium], {{endYear, 5, "Forecast Distance"}, 0, 10, 1,
- Appearance -> "Labeled"}, {{confidenceLevel, 70,
- "Confidence Level"}, 50, 99, 1, Appearance -> "Labeled"},
- SaveDefinitions -> True]
- Manipulate[
- FitComparePlot[turnoverFit["Linear"], linear,
- turnoverCI["Linear", confidenceLevel], 0,
- endYear + Length[turnoverData] - 1],
- Style["TURNOVER LINEAR FIT PLOT", Bold,
- Medium], {{endYear, 5, "Forecast Distance"}, 0, 10, 1,
- Appearance -> "Labeled"}, {{confidenceLevel, 70,
- "Confidence Level"}, 50, 99, 1, Appearance -> "Labeled"},
- SaveDefinitions -> True]
- Manipulate[
- "R^2 Value: " <> ToString[N[turnoverFit["Linear"]["RSquared"]]] <>
- "\n" <> "Mean: " <>
- FitMean[linear, turnoverCI["Linear", confidenceLevel],
- endYear + Length[profitBeforeTaxData] - 1] <> "\n" <>
- "Statistic: " <>
- FitStatistic[linear, turnoverCI["Linear", confidenceLevel],
- endYear + Length[profitBeforeTaxData] - 1] <> "\n" <>
- "Interval: " <>
- FitInterval[linear, turnoverCI["Linear", confidenceLevel],
- endYear + Length[turnoverData] - 1],
- Style["TURNOVER LINEAR FIT INFO", Bold,
- Medium], {{endYear, 5, "Forecast Distance"}, 0, 10, 1,
- Appearance -> "Labeled"}, {{confidenceLevel, 70,
- "Confidence Level"}, 50, 99, 1, Appearance -> "Labeled"},
- SaveDefinitions -> True]
- Manipulate[
- FitComparePlot[turnoverFit["Exponential"], exponential,
- turnoverCI["Exponential", confidenceLevel], 0,
- endYear + Length[turnoverData] - 1],
- Style["TURNOVER EXPONENTIAL FIT PLOT", Bold,
- Medium], {{endYear, 5, "Forecast Distance"}, 0, 10, 1,
- Appearance -> "Labeled"}, {{confidenceLevel, 70,
- "Confidence Level"}, 50, 99, 1, Appearance -> "Labeled"},
- SaveDefinitions -> True]
- Manipulate[
- "R^2 Value: " <>
- ToString[N[turnoverFit["Exponential"]["RSquared"]]] <> "\n" <>
- "Mean: " <>
- FitMean[exponential, turnoverCI["Exponential", confidenceLevel],
- endYear + Length[profitBeforeTaxData] - 1] <> "\n" <>
- "Statistic: " <>
- FitStatistic[exponential,
- turnoverCI["Exponential", confidenceLevel],
- endYear + Length[profitBeforeTaxData] - 1] <> "\n" <>
- "Interval: " <>
- FitInterval[exponential, turnoverCI["Exponential", confidenceLevel],
- endYear + Length[turnoverData] - 1],
- Style["TURNOVER EXPONENTIAL FIT INFO", Bold,
- Medium], {{endYear, 5, "Forecast Distance"}, 0, 10, 1,
- Appearance -> "Labeled"}, {{confidenceLevel, 70,
- "Confidence Level"}, 50, 99, 1, Appearance -> "Labeled"},
- SaveDefinitions -> True]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement